日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
C#文件列表操作四大重點

C#文件列表要點1:上傳文件

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

HTML部分:

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

C#文件列表要點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. 或者也可以通過改變Label的Text值來實現(xiàn)點擊
  21. 后實現(xiàn)文件下載的超級連接
  22. this.Label1.Text=\"〈 ahref=
  23. \\\"Xmlzip/a.rar\\\"〉a.rar〈 /a〉\"

C#文件列表要點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#文件列表要點4.得到文件夾下的文件列表

 
 
 
  1. #region得到當前可用的文件列表
  2. ///〈 summary〉
  3. ///得到當前可用的文件列表
  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(\"查無可以下載的文件!\");
  39. }
  40. }
  41. }
  42. }
  43. catch(Exceptionex)
  44. {
  45. ex.ToString();
  46. }
  47. }
  48. #endregion

網(wǎng)站欄目:C#文件列表操作四大重點
網(wǎng)頁URL:http://www.5511xx.com/article/cdspghg.html