我想上傳一些文件到C#.net中的網站主機Windows應用程序。什麼是在Windows應用程序中上傳文件的最佳方式?用C#.net上傳文件Windows應用程序
2
A
回答
3
這取決於您的服務器。如果它是你的,你可以讓它聽取發佈請求並通過那裏上傳文件。如果不是你的,可能安裝了ftp,所以你可以試試。
在這裏看到FTP上傳:http://www.vcskicks.com/csharp_ftp_upload.php 這裏使用的HTTP POST請求:http://en.csharp-online.net/HTTP_Post
2
我發現SVN是迄今爲止, 在本地計算機上,並在服務器上安裝客戶端的最佳方式。並在服務器上安裝服務器SNV。
服務器:http://www.visualsvn.com/server/
客戶:在C#http://tortoisesvn.net/downloads.html
2
文件上傳
HttpPostedFileBase file = this.Request.Files["Upload"];
if (file != null)
{
var fileName = file.FileName;
var fileExtension = Path.GetExtension(fileName);
filePath = fileName.Replace(fileName, emailTemplateImage.token + fileExtension);
var imagepath = Server.MapPath("/Upload/EmailTemplateImage/") + filePath;
if (!System.IO.Directory.Exists(filePath))
{
System.IO.Directory.CreateDirectory(filePath);
}
file.SaveAs(imagepath);
}
+0
其不錯......... – varun 2015-07-13 11:38:11
相關問題
- 1. 將文件上傳到Windows 10應用程序c中的Pushbullet#
- 2. MongoDB for Windows C#.Net應用程序
- 3. 使用.NET上傳文件用於Windows應用商店
- 4. 我們可以在IIS中上傳Windows應用程序:.net
- 5. 網絡應用程序文件上傳
- 6. iOS上傳文件從應用程序
- 7. 從WPF應用程序上傳文件
- 8. 從Windows應用程序上傳文件到S3 Amazon?
- 9. 在c#.net web應用程序中上傳excel文件導致出錯
- 10. 使用.net windows應用程序創建補丁文件
- 11. C#.net windows應用程序 - 打印文本框值
- 12. 如何檢測USB斷開事件? (Windows,.NET C#應用程序)
- 13. 如何去文件上傳的Web應用程序(ASP.Net,C#,IIS)
- 14. 使用.Net應用程序傳真PDF文件
- 15. IIS .net應用程序,可能在c#應用程序內託管.vb文件?
- 16. 在Windows通用應用程序中使用HttpClient PUT將文件上傳到WebDAV?
- 17. Windows應用程序C
- 18. C#Windows應用程序
- 19. C#Windows應用程序attachmentFilename
- 20. C#Windows應用程序
- 21. C#Windows應用程序
- 22. 應用程序壓力測試在Windows .NET應用程序
- 23. 如何在Windows CE平臺上運行c#.net windows應用程序?
- 24. 使用.NET安裝程序的Windows Vista上的文件安全
- 25. 支持Windows應用程序(VB6.0/VB.NET/C#.NET)和Web應用程序(VB.NET/C#.NET; MVC)的測試工具
- 26. 「用...打開」Windows上的文件,用python應用程序
- 27. C#WinSCP .NET程序集:如何異步上傳多個文件
- 28. 在Visual Studio 2005中使用Crystal Reports(C#.NET Windows應用程序)
- 29. C#.net Windows應用程序安裝程序沒有運行在Windows 7中
- 30. 使用任何用戶的C#.NET應用程序訪問Windows 10上的本地文件
請解釋一下你的 「上傳」 的意思。 – Polyfun 2010-05-14 09:08:41
上傳哪裏?去哪兒? – Oded 2010-05-14 09:11:05