自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

C#文件操作集錦:追加、復(fù)制、刪除與文件夾操作

開發(fā) 后端
本文通過實(shí)例講解C#追加文件、C#拷貝文件 、C#刪除文件等使用方法。

C#文件操作:C#追加文件

  1. StreamWriter sw = File.AppendText(  
  2. Server.MapPath(".")+"\\myText.txt");   
  3. sw.WriteLine("追逐理想");   
  4. sw.WriteLine("kzlll");   
  5. sw.WriteLine(".NET筆記");   
  6. sw.Flush();   
  7. sw.Close();   

C#文件操作:C#拷貝文件

  1. string OrignFile,NewFile;   
  2. OrignFile = Server.MapPath(  
  3. ".")+"\\myText.txt";   
  4. NewFile = Server.MapPath(  
  5. ".")+"\\myTextCopy.txt";   
  6. File.Copy(OrignFile,NewFile,true);   

C#文件操作:C#刪除文件

  1. string delFile = Server.MapPath(  
  2. ".")+"\\myTextCopy.txt";   
  3. File.Delete(delFile);   

C#文件操作:C#移動(dòng)文件

  1. string OrignFile,NewFile;   
  2. OrignFile = Server.MapPath(  
  3. ".")+"\\myText.txt";   
  4. NewFile = Server.MapPath(  
  5. ".")+"\\myTextCopy.txt";   
  6. File.Move(OrignFile,NewFile);   

C#文件操作:C#創(chuàng)建目錄

  1. // 創(chuàng)建目錄c:\sixAge   
  2. DirectoryInfo d=  
  3. Directory.CreateDirectory("c:\\sixAge");   
  4. // d1指向c:\sixAge\sixAge1   
  5. DirectoryInfo d1=  
  6. d.CreateSubdirectory("sixAge1");   
  7. // d2指向c:\sixAge\sixAge1\sixAge1_1   
  8. DirectoryInfo d2=  
  9. d1.CreateSubdirectory("sixAge1_1");   
  10. // 將當(dāng)前目錄設(shè)為c:\sixAge   
  11. Directory.SetCurrentDirectory("  
  12. c:\\sixAge");   
  13. // 創(chuàng)建目錄c:\sixAge\sixAge2   
  14. Directory.CreateDirectory("  
  15. sixAge2");   
  16. // 創(chuàng)建目錄c:\sixAge\sixAge2\sixAge2_1   
  17. Directory.CreateDirectory("  
  18. sixAge2\\sixAge2_1");  

遞歸刪除文件夾及文件

  1. 〈%@PageLanguage=C#%〉  
  2. 〈%@Importnamespace="System.IO"%〉  
  3. 〈Scriptrunat=server〉  
  4. publicvoidDeleteFolder(stringdir)  
  5. {  
  6. if(Directory.Exists(dir))//如果  
  7. 存在這個(gè)文件夾刪除之  
  8. {  
  9. foreach(stringdinDirectory.  
  10. GetFileSystemEntries(dir))  
  11. {  
  12. if(File.Exists(d))  
  13. File.Delete(d);//直接刪除其中的文件  
  14. else 
  15. DeleteFolder(d);//遞歸刪除子文件夾  
  16. }  
  17. Directory.Delete(dir);//刪除已空文件夾  
  18. Response.Write(dir+"文件夾刪除成功");  
  19. }  
  20. else 
  21. Response.Write(dir+"該文件夾不存在");//如果  
  22. 文件夾不存在則提示  
  23. }  
  24. protectedvoidPage_Load(Object  
  25. sender,EventArgse)  
  26. {  
  27. stringDir="D:\\gbook\\11";  
  28. DeleteFolder(Dir);//調(diào)用函數(shù)刪除文件夾  
  29. }  
  30.  
  31.  
  32. //========================================  
  33. //實(shí)現(xiàn)一個(gè)靜態(tài)方法將指定文件夾下面的  
  34. 所有內(nèi)容copy到目標(biāo)文件夾下面  
  35. //如果目標(biāo)文件夾為只讀屬性就會(huì)報(bào)錯(cuò)。  
  36. //April18April2005InSTU  
  37. //========================================  
  38. publicstaticvoidCopyDir(stringsrcPath,  
  39. stringaimPath)  
  40. {  
  41. try  
  42. {  
  43. //檢查目標(biāo)目錄是否以目錄分割字  
  44. 符結(jié)束如果不是則添加之  
  45. if(aimPath[aimPath.Length-1]!=  
  46. Path.DirectorySeparatorChar)  
  47. aimPath+=Path.DirectorySeparatorChar;  
  48. //判斷目標(biāo)目錄是否存在如果不存在則新建之  
  49. if(!Directory.Exists(aimPath))Directory.  
  50. CreateDirectory(aimPath);  
  51. //得到源目錄的文件列表,  
  52. 該里面是包含文件以及目錄路徑的一個(gè)數(shù)組  
  53. //如果你指向copy目標(biāo)文件下面的文件  
  54. 而不包含目錄請(qǐng)使用下面的方法  
  55. //string[]fileList=  
  56. Directory.GetFiles(srcPath);  
  57. string[]fileList=  
  58. Directory.GetFileSystemEntries(srcPath);  
  59. //遍歷所有的文件和目錄  
  60. foreach(stringfileinfileList)  
  61. {  
  62. //先當(dāng)作目錄處理如果存在這個(gè)  
  63. 目錄就遞歸Copy該目錄下面的文件  
  64. if(Directory.Exists(file))  
  65. CopyDir(file,aimPath+Path.GetFileName(file));  
  66. //否則直接Copy文件  
  67. else 
  68. File.Copy(file,aimPath+Path.GetFileName(  
  69. file),true);  
  70. }  
  71. }  
  72. catch(Exceptione)  
  73. {  
  74. MessageBox.Show(e.ToString());  
  75. }  
  76. }  
  77. //========================================  
  78. //實(shí)現(xiàn)一個(gè)靜態(tài)方法將指定文  
  79. 件夾下面的所有內(nèi)容Detele  
  80. //測(cè)試的時(shí)候要小心操作,刪除之后無法恢復(fù)。  
  81. //April18April2005InSTU  
  82. //========================================  
  83. publicstaticvoidDeleteDir(stringaimPath)  
  84. {  
  85. try  
  86. {  
  87. //檢查目標(biāo)目錄是否以目錄分割字  
  88. 符結(jié)束如果不是則添加之  
  89. if(aimPath[aimPath.Length-1]!=  
  90. Path.DirectorySeparatorChar)  
  91. aimPath+=Path.DirectorySeparatorChar;  
  92. //得到源目錄的文件列表,  
  93. 該里面是包含文件以及目錄路徑的一個(gè)數(shù)組  
  94. //如果你指向Delete目標(biāo)文件下面的  
  95. 文件而不包含目錄請(qǐng)使用下面的方法  
  96. //string[]fileList=  
  97. Directory.GetFiles(aimPath);  
  98. string[]fileList=  
  99. Directory.GetFileSystemEntries(aimPath);  
  100. //遍歷所有的文件和目錄  
  101. foreach(stringfileinfileList)  
  102. {  
  103. //先當(dāng)作目錄處理如果存在這個(gè)  
  104. 目錄就遞歸Delete該目錄下面的文件  
  105. if(Directory.Exists(file))  
  106. {  
  107. DeleteDir(aimPath+Path.GetFileName(file));  
  108. }  
  109. //否則直接Delete文件  
  110. else 
  111. {  
  112. File.Delete(aimPath+Path.GetFileName(file));  
  113. }  
  114. }  
  115. //刪除文件夾  
  116. System.IO.Directory.Delete(aimPath,true);  
  117. }  
  118. catch(Exceptione)  
  119. {  
  120. MessageBox.Show(e.ToString());  
  121. }  
  122. }  
  123.  
  124. 需要引用命名空間:  
  125. usingSystem.IO;  
  126.  
  127. /**////〈summary〉  
  128. ///拷貝文件夾(包括子文件夾)到指定文件夾下,  
  129. 源文件夾和目標(biāo)文件夾均需絕對(duì)路徑.  
  130. 格式:CopyFolder(源文件夾,目標(biāo)文件夾);  
  131. ///〈/summary〉  
  132. ///〈paramname="strFromPath"〉〈/param〉  
  133. ///〈paramname="strToPath"〉〈/param〉  
  134.  
  135. //----------------------------------------  
  136. //作者:明天去要飯QQ:305725744  
  137. //----------------------------------------  
  138. publicstaticvoidCopyFolder(stringstrFromPath,  
  139. stringstrToPath)  
  140. {  
  141. //如果源文件夾不存在,則創(chuàng)建  
  142. if(!Directory.Exists(strFromPath))  
  143. {  
  144. Directory.CreateDirectory(strFromPath);  
  145. }  
  146.  
  147. //取得要拷貝的文件夾名  
  148. stringstrFolderName=strFromPath.Substring(  
  149. strFromPath.LastIndexOf("\\")+1,strFromPath.  
  150. Length-strFromPath.LastIndexOf("\\")-1);  
  151.  
  152. //如果目標(biāo)文件夾中沒有源文件夾則在  
  153. 目標(biāo)文件夾中創(chuàng)建源文件夾  
  154. if(!Directory.Exists(strToPath+"\\" 
  155. +strFolderName))  
  156. {  
  157. Directory.CreateDirectory(strToPath+"\\" 
  158. +strFolderName);  
  159. }  
  160. //創(chuàng)建數(shù)組保存源文件夾下的文件名  
  161. string[]strFiles=Directory.GetFiles(strFromPath);  
  162.  
  163. //循環(huán)拷貝文件  
  164. for(inti=0;i〈strFiles.Length;i++)  
  165. {  
  166. //取得拷貝的文件名,只取文件名,地址截掉。  
  167. stringstrFileName=strFiles[i].Substring(  
  168. strFiles[i].LastIndexOf("\\")+1,  
  169. strFiles[i].Length-strFiles[i].  
  170. LastIndexOf("\\")-1);  
  171. //開始拷貝文件,true表示覆蓋同名文件  
  172. File.Copy(strFiles[i],strToPath+"\\" 
  173. +strFolderName+"\\"+strFileName,true);  
  174. }  
  175.  
  176. //創(chuàng)建DirectoryInfo實(shí)例  
  177. DirectoryInfodirInfo=newDirectoryInfo(  
  178. strFromPath);  
  179. //取得源文件夾下的所有子文件夾名稱  
  180. DirectoryInfo[]ZiPath=dirInfo.GetDirectories();  
  181. for(intj=0;j〈ZiPath.Length;j++)  
  182. {  
  183. //獲取所有子文件夾名  
  184. stringstrZiPath=strFromPath+"\\"+  
  185. ZiPath[j].ToString();  
  186. //把得到的子文件夾當(dāng)成新的源文件夾,  
  187. 從頭開始新一輪的拷貝  
  188. CopyFolder(strZiPath,strToPath+"\\"+  
  189. strFolderName);  
  190. }  
  191. }  

#p#

C#文件操作:讀取文本文件

  1. 1/**//// 〈summary〉  
  2. 2/// 讀取文本文件  
  3. 3/// 〈/summary〉  
  4. 4private void ReadFromTxtFile()  
  5. 5{  
  6. 6    if(filePath.PostedFile.  
  7. FileName != "")  
  8. 7    {  
  9. 8    txtFilePath =  
  10. filePath.PostedFile.FileName;  
  11. 9    fileExtName =   
  12. txtFilePath.Substring(txtFilePath.  
  13. LastIndexOf(".")+1,3);  
  14. 10  
  15. 11   if(fileExtName !="txt" &&   
  16. fileExtName != "TXT")  
  17. 12   {  
  18. 13   Response.Write("請(qǐng)選擇文本文件");  
  19. 14   }  
  20. 15   else 
  21. 16   {  
  22. 17   StreamReader fileStream =   
  23. new StreamReader(txtFilePath,Encoding.Default);  
  24. 18   txtContent.Text = fileStream.ReadToEnd();  
  25. 19   fileStream.Close();  
  26. 20   }  
  27. 21   }  
  28. 22 } 

C#文件操作:獲取文件列表

  1. 1/**//// 〈summary〉  
  2. 2/// 獲取文件列表  
  3. 3/// 〈/summary〉  
  4. 4private void GetFileList()  
  5. 5{  
  6. 6  string strCurDir,FileName,FileExt;  
  7. 7      
  8. 8    /**////文件大小  
  9. 9    long FileSize;  
  10. 10      
  11. 11    /**////***修改時(shí)間;  
  12. 12    DateTime FileModify;  
  13. 13  
  14. 14    /**////初始化  
  15. 15    if(!IsPostBack)  
  16. 16    {  
  17. 17  /**////初始化時(shí),默認(rèn)為當(dāng)前頁面所在的目錄  
  18. 18     strCurDir = Server.MapPath(".");  
  19. 19     lblCurDir.Text = strCurDir;  
  20. 20     txtCurDir.Text = strCurDir;  
  21. 21    }  
  22. 22    else 
  23. 23    {  
  24. 24     strCurDir = txtCurDir.Text;  
  25. 25     txtCurDir.Text = strCurDir;  
  26. 26     lblCurDir.Text = strCurDir;  
  27. 27    }  
  28. 28    FileInfo fi;  
  29. 29    DirectoryInfo dir;  
  30. 30    TableCell td;  
  31. 31    TableRow tr;  
  32. 32    tr = new TableRow();  
  33. 33      
  34. 34    /**////動(dòng)態(tài)添加單元格內(nèi)容  
  35. 35    td = new TableCell();  
  36. 36    td.Controls.Add(new LiteralControl(  
  37. "文件名"));  
  38. 37    tr.Cells.Add(td);  
  39. 38    td = new TableCell();  
  40. 39    td.Controls.Add(new LiteralControl(  
  41. "文件類型"));  
  42. 40    tr.Cells.Add(td);  
  43. 41    td = new TableCell();  
  44. 42    td.Controls.Add(new LiteralControl(  
  45. "文件大小"));  
  46. 43    tr.Cells.Add(td);  
  47. 44    td = new TableCell();  
  48. 45    td.Controls.Add(new LiteralControl(  
  49. "***修改時(shí)間"));  
  50. 46    tr.Cells.Add(td);  
  51. 47  
  52. 48    tableDirInfo.Rows.Add(tr);  
  53. 49      
  54. 50    /**////針對(duì)當(dāng)前目錄建立目錄引用對(duì)象  
  55. 51    DirectoryInfo dirInfo = new DirectoryInfo(  
  56. txtCurDir.Text);  
  57. 52      
  58. 53    /**////循環(huán)判斷當(dāng)前目錄下的文件和目錄  
  59. 54    foreach(FileSystemInfo fsi in dirInfo.  
  60. GetFileSystemInfos())  
  61. 55    {  
  62. 56      FileName = "";  
  63. 57      FileExt = "";  
  64. 58      FileSize = 0;  
  65. 59          
  66. 60      /**////如果是文件  
  67. 61      if(fsi is FileInfo)  
  68. 62      {  
  69. 63      fi = (FileInfo)fsi;  
  70. 64              
  71. 65      /**////取得文件名  
  72. 66      FileName = fi.Name;  
  73. 67              
  74. 68     /**////取得文件的擴(kuò)展名  
  75. 69     FileExt = fi.Extension;  
  76. 70              
  77. 71    /**////取得文件的大小  
  78. 72    FileSize = fi.Length;  
  79. 73              
  80. 74   /**////取得文件的***修改時(shí)間  
  81. 75   FileModify = fi.LastWriteTime;  
  82. 76   }  
  83. 77  
  84. 78   /**////否則是目錄  
  85. 79   else 
  86. 80    {  
  87. 81    dir = (DirectoryInfo)fsi;  
  88. 82              
  89. 83     /**////取得目錄名  
  90. 84     FileName = dir.Name;  
  91. 85              
  92. 86     /**////取得目錄的***修改時(shí)間  
  93. 87     FileModify = dir.LastWriteTime;  
  94. 88              
  95. 89     /**////設(shè)置文件的擴(kuò)展名為"文件夾" 
  96. 90    FileExt = "文件夾";  
  97. 91     }  
  98. 92          
  99. 93    /**////動(dòng)態(tài)添加表格內(nèi)容  
  100. 94        tr = new TableRow();  
  101. 95        td = new TableCell();  
  102. 96        td.Controls.Add(new LiteralControl(  
  103. FileName));  
  104. 97        tr.Cells.Add(td);  
  105. 98        td = new TableCell();  
  106. 99        td.Controls.Add(new LiteralControl(  
  107. FileExt));  
  108. 100        tr.Cells.Add(td);  
  109. 101        td = new TableCell();  
  110. 102        td.Controls.Add(new LiteralControl(  
  111. FileSize.ToString()+"字節(jié)"));  
  112. 103        tr.Cells.Add(td);  
  113. 104        td = new TableCell();  
  114. 105        td.Controls.Add(new LiteralControl(  
  115. FileModify.ToString("yyyy-mm-dd hh:mm:ss")));  
  116. 106        tr.Cells.Add(td);  
  117. 107        tableDirInfo.Rows.Add(tr);  
  118. 108    }  
  119. 109} 

C#文件操作:讀取日志文件

  1. 1/**//// 〈summary〉  
  2. 2/// 讀取日志文件  
  3. 3/// 〈/summary〉  
  4. 4private void ReadLogFile()  
  5. 5{  
  6. 6    /**////從指定的目錄以打  
  7. 開或者創(chuàng)建的形式讀取日志文件  
  8. 7    FileStream fs =   
  9. new FileStream(Server.MapPath("upedFile" 
  10. )+"\\logfile.txt", FileMode.OpenOrCreate,   
  11. FileAccess.Read);  
  12. 8  
  13. 9    /**////定義輸出字符串  
  14. 10    StringBuilder output =   
  15. new StringBuilder();  
  16. 11      
  17. 12    /**////初始化該字符串的長(zhǎng)度為0  
  18. 13    output.Length = 0;  
  19. 14      
  20. 15    /**////為上面創(chuàng)建的文件流創(chuàng)建讀取數(shù)據(jù)流  
  21. 16    StreamReader read = new StreamReader(fs);  
  22. 17      
  23. 18    /**////設(shè)置當(dāng)前流的起始位置為文件流的起始點(diǎn)  
  24. 19    read.BaseStream.Seek(0, SeekOrigin.Begin);  
  25. 20      
  26. 21    /**////讀取文件  
  27. 22    while (read.Peek() 〉 -1)   
  28. 23    {  
  29. 24        /**////取文件的一行內(nèi)容并換行  
  30. 25        output.Append(read.ReadLine() + "\n");  
  31. 26    }  
  32. 27      
  33. 28    /**////關(guān)閉釋放讀數(shù)據(jù)流  
  34. 29    read.Close();  
  35. 30      
  36. 31    /**////返回讀到的日志文件內(nèi)容  
  37. 32    return output.ToString();  
  38. 33} 

#p#

C#文件操作:寫入日志文件

  1. 1/**//// 〈summary〉  
  2. 2/// 寫入日志文件  
  3. 3/// 〈/summary〉  
  4. 4/// 〈param name="input"〉〈/param〉  
  5. 5private void WriteLogFile(string input)  
  6. 6{      
  7. 7    /**////指定日志文件的目錄  
  8. 8    string fname = Server.MapPath(  
  9. "upedFile") + "\\logfile.txt";  
  10. 9    /**////定義文件信息對(duì)象  
  11. 10    FileInfo finfo = new FileInfo(fname);  
  12. 11  
  13. 12    /**////判斷文件是否存在以及是否大于2K  
  14. 13    if ( finfo.Exists && finfo.Length 〉  
  15.  2048 )  
  16. 14    {  
  17. 15        /**////刪除該文件  
  18. 16        finfo.Delete();  
  19. 17    }  
  20. 18    /**////創(chuàng)建只寫文件流  
  21. 19   using(FileStream fs = finfo.OpenWrite())  
  22. 20    {  
  23. 21   /**////根據(jù)上面創(chuàng)建的文件流創(chuàng)建寫數(shù)據(jù)流  
  24. 22   StreamWriter w = new StreamWriter(fs);  
  25. 23          
  26. 24    /**////設(shè)置寫數(shù)據(jù)流的起始位置為文件流的末尾  
  27. 25   w.BaseStream.Seek(0, SeekOrigin.End);  
  28. 26          
  29. 27    /**////寫入“Log Entry : ”  
  30. 28    w.Write("\nLog Entry : ");  
  31. 29          
  32. 30   /**////寫入當(dāng)前系統(tǒng)時(shí)間并換行  
  33. 31    w.Write("{0} {1} \r\n", DateTime.Now.  
  34. ToLongTimeString(),  
  35. 32     DateTime.Now.ToLongDateString());  
  36. 33          
  37. 34    /**////寫入日志內(nèi)容并換行  
  38. 35    w.Write(input + "\n");  
  39. 36          
  40. 37    /**////寫入----------------“并換行  
  41. 38    w.Write("------------------\n");  
  42. 39          
  43. 40  /**////清空緩沖區(qū)內(nèi)容,并把緩沖區(qū)內(nèi)容寫入基礎(chǔ)流  
  44. 41   w.Flush();  
  45. 42          
  46. 43        /**////關(guān)閉寫數(shù)據(jù)流  
  47. 44        w.Close();  
  48. 45    }  
  49. 46} 

C#文件操作:創(chuàng)建HTML文件

  1. 1/**//// 〈summary〉  
  2. 2/// 創(chuàng)建HTML文件  
  3. 3/// 〈/summary〉  
  4. 4private void CreateHtmlFile()  
  5. 5{      
  6. 6    /**////定義和html標(biāo)記數(shù)目一致的數(shù)組  
  7. 7    string[] newContent = new string[5];  
  8. 8    StringBuilder strhtml =   
  9. new StringBuilder();  
  10. 9    try   
  11. 10    {  
  12. 11    /**////創(chuàng)建StreamReader對(duì)象  
  13. 12    using (StreamReader sr =   
  14. new StreamReader(Server.MapPath("  
  15. createHTML") + "\\template.html"))   
  16. 13        {  
  17. 14     String oneline;  
  18. 15              
  19. 16     /**////讀取指定的HTML文件模板  
  20. 17     while ((oneline = sr.ReadLine())   
  21. != null)   
  22. 18     {  
  23. 19     strhtml.Append(oneline);  
  24. 20            }  
  25. 21     sr.Close();  
  26. 22        }  
  27. 23    }  
  28. 24    catch(Exception err)  
  29. 25    {  
  30. 26        /**////輸出異常信息  
  31. 27        Response.Write(err.ToString());  
  32. 28    }  
  33. 29    /**////為標(biāo)記數(shù)組賦值  
  34. 30    newContent[0] = txtTitle.Text;//標(biāo)題  
  35. 31    newContent[1] = "BackColor='  
  36. #cccfff'";//背景色  
  37. 32    newContent[2] = "#ff0000";//字體顏色  
  38. 33    newContent[3] = "100px";//字體大小  
  39. 34    newContent[4] = txtContent.Text;//主要內(nèi)容  
  40. 35  
  41. 36    /**////根據(jù)上面新的內(nèi)容生成html文件  
  42. 37    try  
  43. 38    {  
  44. 39    /**////指定要生成的HTML文件  
  45. 40    string fname = Server.MapPath(  
  46. "createHTML") +"\\" + DateTime.Now.ToString(  
  47. "yyyymmddhhmmss") + ".html";  
  48. 41          
  49. 42   /**////替換html模版文件里的標(biāo)記為新的內(nèi)容  
  50. 43   for(int i=0;i 〈 5;i++)  
  51. 44   {  
  52. 45    strhtml.Replace("$htmlkey["+i+"]",newContent[i]);  
  53. 46    }  
  54. 47    /**////創(chuàng)建文件信息對(duì)象  
  55. 48    FileInfo finfo = new FileInfo(fname);  
  56. 49          
  57. 50    /**////以打開或者寫入的形式創(chuàng)建文件流  
  58. 51    using(FileStream fs = finfo.OpenWrite())  
  59. 52   {  
  60. 53    /**////根據(jù)上面創(chuàng)建的文件流創(chuàng)建寫數(shù)據(jù)流  
  61. 54  StreamWriter sw = new StreamWriter(fs,System.  
  62. Text.Encoding.GetEncoding("GB2312"));  
  63. 55              
  64. 56   /**////把新的內(nèi)容寫到創(chuàng)建的HTML頁面中  
  65. 57   sw.WriteLine(strhtml);  
  66. 58   sw.Flush();  
  67. 59   sw.Close();  
  68. 60   }  
  69. 61          
  70. 62   /**////設(shè)置超級(jí)鏈接的屬性  
  71. 63  hyCreateFile.Text =   
  72. DateTime.Now.ToString("yyyymmddhhmmss")+".html";  
  73. 64  hyCreateFile.NavigateUrl = "  
  74. createHTML/"+DateTime.Now.ToString(" 
  75. yyyymmddhhmmss")+".html";  
  76. 65    }  
  77. 66    catch(Exception err)  
  78. 67    {   
  79. 68        Response.Write (err.ToString());  
  80. 69    }  
  81. 70 }  

【編輯推薦】

  1. 詳細(xì)介紹C#編譯器
  2. C#異常機(jī)制的相關(guān)解釋
  3. 在C#程序編譯另一個(gè)程序的實(shí)現(xiàn)方法
  4. C#類庫編譯兩步走
  5. C#條件編譯指令淺析
責(zé)任編輯:冰荷 來源: blog
相關(guān)推薦

2009-09-01 10:28:38

C#追加文件

2009-08-12 16:57:28

C#讀取文件夾

2009-09-02 19:22:03

C#遞歸

2011-05-23 17:00:29

2009-09-09 18:20:29

C# XML編程

2009-09-01 10:10:51

C# StreamRe

2009-08-31 18:38:59

C#寫文件

2009-08-18 17:05:08

C#操作xml文件

2009-08-17 08:04:00

C#高級(jí)編程

2009-08-31 12:56:36

C#創(chuàng)建文件夾

2010-01-13 10:25:30

VB.NET文件夾操作

2024-04-03 00:10:24

C#System數(shù)據(jù)

2009-08-28 15:49:45

C#對(duì)INI文件操作

2009-08-31 10:56:54

C#創(chuàng)建文件夾

2009-08-31 12:31:45

C#創(chuàng)建文件夾

2009-08-19 13:34:55

C#操作注冊(cè)表

2009-10-27 11:03:16

VB.NET文件夾操作

2009-08-17 08:01:00

C#文件列表

2013-05-28 10:17:02

Windows.old故障恢復(fù)

2024-03-04 10:41:25

C#開發(fā)后端
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)