Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

c# sting functions 1

Status
Not open for further replies.

Waynest

Programmer
Jun 22, 2000
321
GB
Hi

I'm going through the painful transition from vb to c#, have pity :)

I have fileupload control which has following property containing filename complete with directories:

FileUpload1.PostedFile.FileName

I want to use just the filename and get rid of directories from the string

I thought I'd knock something up to strip everything off before the last "\" but I'm hopeless without my vb string and conversion functions, I'm pulling me hair out.

How do you do it in c# pls?







 
Like you would do it in vb ;-)

use system.io.path it has all the functions you need like getting the filename, the directory and the filetype.

Christiaan Baes
Belgium

My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top