如何通过c#代码上传文件 [英] how to upload file via c# code

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

问题描述

我想创建一个允许上传的网页。

我的问题是:不使用网络浏览器我想在System.Net中使用HttpWebRequest或WebClient等东西或某种以编程方式上传文件,同时将复选框发送到该上传页面。

我刚读过这个链接:
http://bytes.com/topic/c-sharp/answe...de#post1076309


我不清楚服务器代码。是的,拜托,告诉我服务器代码。

对不起英语不好。

解决方案

我不明白你在尝试什么要做什么。


您想通过网页将文件上传到服务器吗?


或者您想要创建桌面应用程序吗?将网页文件上传到服务器?


-Frinny


感谢您的回复!

hmm,我正在尝试创建一个将图像上传到本地asp.net网页的应用程序!

而且,我不知道如何在asp.net项目中编码(服务器? )

请查看我上面给出的链接以获取更多信息!


@ thevinh92,


您在第一篇文章中添加的内容是使用ASP.net技术创建的服务器端网页。要创建ASP.net网页,您可以使用VB.net或C#.net语言。


现在,您可以使用两种技术在Web服务器上传图像。一个是在您的Web服务器的文件系统中。另一个是在你的网络服务器的数据库系统中。


现在,问题是你需要什么?为您提供ASP.net图像/文件上传代码示例,或者描述您在第一篇文章中链接的代码。


希望它对您有所帮助。 :)

Hi, i want to create a web page that allow to be upload.
And my question is: without using the web browser I want to use something in System.Net such as HttpWebRequest or WebClient or some kind to programmatically upload a file along with sending the checkbox to that upload page.
And i have just read this link:
http://bytes.com/topic/c-sharp/answe...de#post1076309

and i don''t know the server code clearly. Yes, please, tell me the server code.
sorry for bad english.

解决方案

I don''t understand what you are trying to do.

Do you want to upload a file to the server through a webpage?

Or do you want to create a desktop application that uploads a webpage-file to a server?

-Frinny


thanks for your reply!
hmm, i''m trying to create a application that upload Images to a local asp.net web page!
And, i don''t know how to code in the asp.net project (the server?)
Please, take a look in the link I gave above for more information!


@thevinh92,

What you added above in your first post is a server side webpage created using ASP.net technology. To create a ASP.net webpage you can use VB.net or C#.net language.

Now, you can upload image in your web server using two technique. one is in your web server''s file system. and another is in your web server''s database system.

Now, question is what you need? to sample you a ASP.net image/file upload code or to describe you the code that you linked in your first post.

hope it''s help you. :)


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

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