通过webclient上传文本文件 [英] Upload a text file thru webclient

查看:58
本文介绍了通过webclient上传文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图通过此代码上传一个txt文件,但它没有更新

数据。这个代码很好。

或者任何人都可以建议我做一些其他方法。

紧急请帮助


问候

shantanu


WebClient客户端=新WebClient();

client.Credentials = netCred;

client.Headers.Add(Content-Type,application / x-www-form-

urlencoded);

client.UploadFile( " http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/

ImportForm.cgi"," POST",@" C:\ PRP \ PRPTemp.txt");

Hi
i am trying to upload a txt file thru this code, but its not updating
the data. is this code fine.
Or can anybody please suggest me some other meathod to do the same.
its urgent please help

regards
shantanu

WebClient client = new WebClient();
client.Credentials = netCred;
client.Headers.Add("Content-Type","application/x-www-form-
urlencoded");
client.UploadFile("http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/
ImportForm.cgi","POST",@"C:\PRP\PRPTemp.txt");

推荐答案




似乎很好对我来说,你遇到了什么问题?


" shantanu" < sh *********** @ gmail.comwrote in message

news:11 ******************* ***@i38g2000prf.googlegr oups.com ...
Hi,

It seems fine to me , what problems are you getting?

"shantanu" <sh***********@gmail.comwrote in message
news:11**********************@i38g2000prf.googlegr oups.com...



i我试图通过此代码上传txt文件,但是它没有更新

的数据。这个代码很好。

或者任何人都可以建议我做一些其他方法。

紧急请帮助


问候

shantanu


WebClient客户端=新WebClient();

client.Credentials = netCred;

client.Headers.Add(Content-Type,application / x-www-form-

urlencoded);

client.UploadFile( " http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/

ImportForm.cgi"," POST",@" C:\ PRP \ PRPTemp.txt");
Hi
i am trying to upload a txt file thru this code, but its not updating
the data. is this code fine.
Or can anybody please suggest me some other meathod to do the same.
its urgent please help

regards
shantanu

WebClient client = new WebClient();
client.Credentials = netCred;
client.Headers.Add("Content-Type","application/x-www-form-
urlencoded");
client.UploadFile("http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/
ImportForm.cgi","POST",@"C:\PRP\PRPTemp.txt");



6月20日下午5:28,Ignacio Machin \(.NET / C#MVP \)" < machin TA

laceupsolutions.comwrote:
On Jun 20, 5:28 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions.comwrote:




似乎很好我,你有什么问题?


" shantanu" < shantanuse ... @ gmail.com写信息


新闻:11 ********************** @ i38g2000prf.googlegr oups.com ...
Hi,

It seems fine to me , what problems are you getting?

"shantanu" <shantanuse...@gmail.comwrote in message

news:11**********************@i38g2000prf.googlegr oups.com...



i我试图通过这段代码上传一个txt文件,但它没有更新

数据。这个代码很好。

或者任何人都可以建议我做一些其他的方法来做同样的事情。

紧急请帮助
Hi
i am trying to upload a txt file thru this code, but its not updating
the data. is this code fine.
Or can anybody please suggest me some other meathod to do the same.
its urgent please help


问候

shantanu
regards
shantanu


WebClient客户端=新WebClient();

client.Credentials = netCred;

client.Headers.Add(" Content-Type"," application / x-www-form-

urlencoded");

client.UploadFile(" http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/

ImportForm。 cgi"," POST",@" C:\ PRP \ PRPTemp.txt"); - 隐藏引用的文字 -
WebClient client = new WebClient();
client.Credentials = netCred;
client.Headers.Add("Content-Type","application/x-www-form-
urlencoded");
client.UploadFile("http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/
ImportForm.cgi","POST",@"C:\PRP\PRPTemp.txt");- Hide quoted text -



- 显示引用的文字 -


- Show quoted text -



hi thanx回复

i我真的很困惑它没有给出任何错误

可以有任何可能性访问权限

该链接具有GUI文件上传选项和导入按钮。

视为

shantanu

hi thanx for the reply
i am really confused it is giving no error
can there be any posibility of acess rights
the link has GUI with a file upload option ans a import button.
regards
shantanu


从你的描述中,这是一个标准的用户页面(因为你提到了

GUI);我倾向于通过浏览器上传文件,运行fiddler

以查看发送的内容 - 特别查看任何

其他表单变量你可以通过查看表单获得尽可能多的

,但是fiddler可能更容易,特别是因为

这是http而不是https(虽然fiddler 2在IE中使用SSL)


Marc
From your description, this is a standard user page (since you mention
GUI); I''d be inclined to upload a file via a browser, with "fiddler"
running to see what gets sent - looking in particular at any
additional form variables, cookies, etc. You can probably get as much
by looking at the form, but "fiddler" may be easier, especially since
this is http not https (although fiddler 2 works with SSL in IE)

Marc


这篇关于通过webclient上传文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆