av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

C#文件列表操作四大重點(diǎn)

C#文件列表要點(diǎn)1:上傳文件

創(chuàng)新互聯(lián)建站服務(wù)項(xiàng)目包括鐵嶺網(wǎng)站建設(shè)、鐵嶺網(wǎng)站制作、鐵嶺網(wǎng)頁(yè)制作以及鐵嶺網(wǎng)絡(luò)營(yíng)銷(xiāo)策劃等。多年來(lái),我們專(zhuān)注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢(shì)、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,鐵嶺網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶(hù)以成都為中心已經(jīng)輻射到鐵嶺省份的部分城市,未來(lái)相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶(hù)的支持與信任!

HTML部分:

 
 
 
  1. 〈 formid=\"form1\"runat=\"
  2. server\"method=\"post\"enctype=\
  3. "multipart/form-data\"〉
  4. 〈 inputid=\"FileUpLoad\"type=\"
  5. file\"runat=\"server\"/〉〈 br/〉
  6. 后臺(tái)CS部分按鈕事件
  7. //stringstrFileFullName=
  8. System.IO.Path.GetFileName(this.
  9. FileUpLoad.PostedFile.FileName);
  10. //this.FileUpLoad.PostedFile.SaveAs(Server.MapPath(
  11. \"./Xmlzip/\")+strFileFullName);

C#文件列表要點(diǎn)2.文件下載

 
 
 
  1. ListBox的SelectedIndexChanged事件設(shè)
  2. 定相關(guān)下載連接
  3. protectedvoidlst_DownLoadFileList
  4. _SelectedIndexChanged(objectsender,EventArgse)
  5. {
  6. try
  7. {
  8. stringstrJS=\"window.open(\'Xmlzip/\";
  9. strJS+=this.lst_DownLoadFileList.
  10. SelectedItem.Text.Trim();
  11. strJS+=\"\');returnfalse;\";
  12. this.imgbtn_DownLoadFile.Attributes.
  13. Add(\"onclick\",strJS);
  14. }
  15. catch(Exceptionex)
  16. {
  17. ex.ToString();
  18. }
  19. }
  20. 或者也可以通過(guò)改變Label的Text值來(lái)實(shí)現(xiàn)點(diǎn)擊
  21. 后實(shí)現(xiàn)文件下載的超級(jí)連接
  22. this.Label1.Text=\"〈 ahref=
  23. \\\"Xmlzip/a.rar\\\"〉a.rar〈 /a〉\"

C#文件列表要點(diǎn)3.文件刪除

 
 
 
  1. stringstrFilePath=Server.MapPath(
  2. \"../CountryFlowMgr/Xmlzip/\"+this.lst_
  3. DownLoadFileList.SelectedItem.Text.Trim());
  4. if(File.Exists(strFilePath))
  5. {
  6. File.Delete(strFilePath);
  7. if(File.Exists(strFilePath))
  8. {
  9. Response.Write(\"ok\");
  10. }
  11. else
  12. {
  13. Response.Write(\"ok\");
  14. }
  15. }

C#文件列表要點(diǎn)4.得到文件夾下的文件列表

 
 
 
  1. #region得到當(dāng)前可用的文件列表
  2. ///〈 summary〉
  3. ///得到當(dāng)前可用的文件列表
  4. ///〈 /summary〉
  5. ///〈 paramname=\"IsAlert\"〉
  6. 是否需要彈出提示信息〈 /param〉
  7. privatevoidfn_getCurrFileList(boolIsAlert)
  8. {
  9. try
  10. {
  11. //查找Xmlzip文件夾下屬于其本
  12. 身UnitCoding的相關(guān)zip文件
  13. stringstrXmlZipDirectory=
  14. Server.MapPath(\"../Xmlzip/\");
  15. if(Directory.Exists(strXmlZipDirectory))
  16. {
  17. //DirectoryInfodi=newDirectoryInfo(
  18. Environment.CurrentDirectory);
  19. DirectoryInfodi=newDirectoryInfo(
  20. strXmlZipDirectory);
  21. FileInfo[]FI=di.GetFiles(\"*.zip\"
  22. );//只查.zip文件
  23. if(FI.Length〉0)
  24. {
  25. lst_DownLoadFileList.Items.Clear();
  26. foreach(FileInfotmpFIinFI)
  27. {
  28. ListItemtmpItem=newListItem();
  29. tmpItem.Text=tmpFI.Name;
  30. lst_DownLoadFileList.Items.Add(tmpItem);
  31. }
  32. lst_DownLoadFileList.SelectedIndex=0;
  33. }
  34. else
  35. {
  36. if(IsAlert)
  37. {
  38. Response.write(\"查無(wú)可以下載的文件!\");
  39. }
  40. }
  41. }
  42. }
  43. catch(Exceptionex)
  44. {
  45. ex.ToString();
  46. }
  47. }
  48. #endregion

名稱(chēng)欄目:C#文件列表操作四大重點(diǎn)
分享網(wǎng)址:http://uogjgqi.cn/article/cdspghg.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們?cè)谖⑿派?4小時(shí)期待你的聲音

解答本文疑問(wèn)/技術(shù)咨詢(xún)/運(yùn)營(yíng)咨詢(xún)/技術(shù)建議/互聯(lián)網(wǎng)交流