C#中的Smart Client中的文件上传器 [英] File uploader in Smart Client in C#

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

问题描述



我想创建一个用于通过C#在SmartClient中上传文件的应用程序.有谁能够帮助我?我正在努力工作.我需要将文件(媒体文件)上传到远程服务器.

Hi,

I want to create an application for uploading a file in a SmartClient by C#. Can anybody help me? I am struggling big time. I need to upload files (media files) to a remote server.

推荐答案

晚上好,先生...


不用担心..据我所知,我告诉您有关上传文件的信息.

Asp.net中有FileUpLoad控件.使用它可以上传文件..我在给您一个上传示例:

fileuplaod1.saveAs(server.mapPath(〜Img//)+ fileuplaod1.filename.tostring());
Hi Good Evening Sir...


Do not Worry.. Whatever I know i am telling you about upload file..

there is FileUpLoad Control in Asp.net Use this to upload file.. i am giving you a example of upload :

fileuplaod1.saveAs(server.mapPath(~Img//)+fileuplaod1.filename.tostring());


自从过去两周以来,这让我很痛.

用于从智能客户端(桌面应用程序)上传...

字符串路径="http://devserver1/HtmlTest/UploadMedia/";
字符串fileName = System.IO.Path.GetFileName(textBox1.Text);
Uri uri =新的Uri(path + fileName);
WebClient客户端=新的WebClient();
client.UploadFile(uri,"PUT",fileName);
MessageBox.Show("Uploded ..");

在那之后检查以下内容...最重要
在IIS下,展开"Web服务扩展".有一个WebDAV服务扩展.检查它是否被允许".如果否,则将其允许.

享受.
It hurt me since last 2 weeks..but atlast i found it..

For uploading from smart client(desktop application)...

string path = "http://devserver1/HtmlTest/UploadMedia/";
string fileName = System.IO.Path.GetFileName(textBox1.Text);
Uri uri = new Uri(path+fileName);
WebClient client = new WebClient();
client.UploadFile(uri,"PUT", fileName);
MessageBox.Show("Uploded..");

After that check the following... MOST IMPORTANT
Under IIS, expand the Web Service Extensions. There is a WebDAV service extension. Check whether it is "allow"ed or not..if not then make it ALLOW.

enjoy..


这篇关于C#中的Smart Client中的文件上传器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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