473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Getting the FileName

1
Hello, I was wondering, how do I get the actual file name of a file, I tried using
Dim ofd As New OpenFileDialog
...
If ofd.ShowDialog = Windows.Forms.DialogResult.OK then

'problem is here!
label1.text = ofd.filename
'problem is here!

End if
...

I would like it to just show the actual file that ofd opened, not the filepath, any ideas on this?

Thanks,
SFlpm
Feb 14 '07 #1
4 1328
Killer42
8,435 Expert 8TB
What version of VB is this? I can't even create an OpenFileDialog object, in VB6.
Feb 15 '07 #2
Esmael
58
Hi...

What reference did u add? what versioin VB?
You can also use a Common Dialog Control if you want...
Feb 15 '07 #3
TNT
48
Just chop the front of the filepath off until you get to the filename. Ltrim() would be a way of doing this.

I think they are either running VisualBasic.NET or VisualBasic 2005.
Feb 15 '07 #4
Killer42
8,435 Expert 8TB
Just chop the front of the filepath off until you get to the filename. Ltrim() would be a way of doing this.

I think they are either running VisualBasic.NET or VisualBasic 2005.
Unless it has changed considerably since I last used it, the LTrim() function just trims off leading spaces. How would that help?
Feb 15 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jay donnell | last post by:
I have a short multi-threaded script that checks web images to make sure they are still there. I get a segmentation fault everytime I run it and I can't figure out why. Writing threaded scripts is...
4
by: Alex Moskalyuk | last post by:
We have a filename, which could theoretically be something like verylongfilename.2004.05.11.txt. We just need the significant part before the first dot. My solution was a quick regexp: filename...
0
by: ruju00 | last post by:
I am getting an error in Login() method of the following class FtpConnection public class FtpConnection { public class FtpException : Exception { public FtpException(string message) :...
2
by: Darrel | last post by:
I have a working function that grabs an image from a FILE form field and get's the filename from it: imageToCheck = myFormField.postedfile checkedFileName = Mid(imageToCheck.FileName,...
185
by: jacob navia | last post by:
Hi We are rewriting the libc for the 64 bit version of lcc-win and we have added a new field in the FILE structure: char *FileName; fopen() will save the file name and an accessor function will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.