记录下: http://topic.csdn.net/u/20070402/21/aace3e6a-aa8f-470b-b383-b23472e4b68e.html?seed=80519963
C#的代码:逐行读取文本文件的内容,把内容整理成CSV文件!
http://topic.csdn.net/u/20070405/06/2c2f93b8-908f-4d30-aefb-02632051997c.html
Path.GetFileNameWithoutExtension( "C:\\abc.jpg "); // abc
Path.ChangeExtension( "C:\\abc.jpg ", null); // c:\abc
DirectoryInfo di=new DirectoryInfo( ".... ");
foreach(FileInfo fi in di.GetFiles( "*.XML "))
{....}
string strDirlist = sPath;//传入路径
DirectoryInfo thisOne = new DirectoryInfo(strDirlist);
FileInfo[] fileInfo = thisOne.GetFiles();
foreach (FileInfo fi in fileInfo)
{
if(fi.Extension.toString()== "XML ")
{
Response.Write( " <a href= ' " + sPath + "\\ " + fi.Name.ToString() + " ' target= '_blank '> " + fi.Name.ToString() + " </a> "+ " <br> ");
}
}
![](http://www.cnblogs.com/Emoticons/yoyocici/224024437.gif)
![](http://www.cnblogs.com/Emoticons/baimantou/223332344.gif)
![](http://www.cnblogs.com/Emoticons/tusiji/203330832.gif)