在winform中如何上传文件到服务器?(在线求救) FTP http://www.codeproject.com/csharp/FTP.asp 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfSystemNetWebClientClassTopic.htm 这个就是HTTP的呀!别告诉我你要用套接字吧!那就有点烦了。呵呵! try{String uriString ="http://192.168.0.56/testweb";WebClient myWebClient = new WebClient();string fileName = this.tBlocalFile.Text.ToString();byte[] responseArray = myWebClient.UploadFile(uriString,"POST",fileName);MessageBox.Show("上传成功!");}catch(Exception ex){MessageBox.Show(ex.Message);}异常:远程服务器返回错误:(405)不允许的方法我在虚拟目录中设置了“写入”的。为什么会报这个异常? 视觉密码(VisualCrypto) 疑难问题!高手请进!急急急急! 重载WndProc问题,好想很难 用C#怎么做计算器 怎么读注册表的二进制值和双字节值? vs2003能自动备份项目吗 C# 请教解析HTML的思路方法 存储过程 合并结果集及参数 wpf 窗口刷新问题 类型的错误! Microsoft is working on another new programming language "X#"? 入门请教
别告诉我你要用套接字吧!那就有点烦了。呵呵!
{
String uriString ="http://192.168.0.56/testweb";
WebClient myWebClient = new WebClient();
string fileName = this.tBlocalFile.Text.ToString();
byte[] responseArray = myWebClient.UploadFile(uriString,"POST",fileName);
MessageBox.Show("上传成功!");
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
异常:远程服务器返回错误:(405)不允许的方法
我在虚拟目录中设置了“写入”的。为什么会报这个异常?