It's not who you are underneath, it's what you do that defines you

Asp.Net 获取FileUpload控件的文件路径、文件名

string fileNameNo = Path.GetFileName(FileUploadImg.PostedFile.FileName);                 //获取文件名和扩展名
string DirectoryName = Path.GetDirectoryName(FileUploadImg.PostedFile.FileName);         //获取文件所在目录
string Extension = Path.GetExtension(FileUploadImg.PostedFile.FileName);                 //获取扩展名
string fileName = Path.GetFileNameWithoutExtension(FileUploadImg.PostedFile.FileName);   //获取文件名(不包括扩展名)
string fullPath = Path.GetFullPath(FileUploadImg.PostedFile.FileName);                   //获取文件的绝对路径
string PathRoot = Path.GetPathRoot(FileUploadImg.PostedFile.FileName);                 
 //获取文件所在地分区

posted @ 2012-06-01 13:52  金铭杰  阅读(1557)  评论(0编辑  收藏  举报

Brick walls are there for a reason :they let us prove how badly we want things