473,473 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Truncate filename without regex??

When I use a OpenFileDialog to open a file I get a filename:

OpenFileDialog1.FileName

It is a complete filespec including directories and drive.

Can a name only string be obtained withour regex.
--
mark b
Dec 10 '05 #1
2 1407
"mark" <ma**@discussions.microsoft.com> schrieb:
When I use a OpenFileDialog to open a file I get a filename:

OpenFileDialog1.FileName

It is a complete filespec including directories and drive.

Can a name only string be obtained withour regex.


'System.IO.Path.GetFileName'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Dec 10 '05 #2
"mark" <ma**@discussions.microsoft.com> schrieb
When I use a OpenFileDialog to open a file I get a filename:

OpenFileDialog1.FileName

It is a complete filespec including directories and drive.

Can a name only string be obtained withour regex.

System.IO.Path.GetFileName
Armin
Dec 10 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Martin Lucas-Smith | last post by:
I am trying to take a string and split it into a filename and a number where the number is what follows the *last* instance of a comma in that string. Split and explode won't work because if the...
3
by: Martin Lucas-Smith | last post by:
Is there some way of using ereg to detect when certain filename extensions are supplied and to return false if so, WITHOUT using the ! operator before ereg () ? I have an API that allows as an...
3
by: Shawn Wilson | last post by:
Hi, I've created a PHP file called filename.jpg. It outputs a JPG. I've set up a .htaccess file to force the filetype to PHP. The file is displayed in a page on a browser. I cannot get the...
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...
2
by: rdraider | last post by:
Hi, I am trying to create a script that deletes transaction tables and leaves master data like customer, vendors, inventory items, etc. How can I use TRUNCATE TABLE with an Exists? My problem is...
2
by: Brian Parker | last post by:
I have an ArrayList ( strings ) of filenames like such: fred.out inctructions.txt luncheon01.jpg luncheon02.jpg luncheon05.jpg luncheon11.jpg HeebieJeebie.cs ...etc..
14
by: Sala | last post by:
Hi I want to truncate all data in database ... pls help me how i ll truncate?
1
by: iceman | last post by:
Hi all, How do I truncate the file size.Is it possible to do this using fopen ,fseek and fwrite. Suppose I have a file of 30 KB if I want to reduce the size to 15KB,Howcan I do this without...
18
by: RedLars | last post by:
Hi, How can check using .NET 1.1 that a string contains a valid filename for winxp? The application in question has a textbox where user can enter filename and only the filename. It should...
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
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.