socket 上传文件到服务器 B/S环境下 asp.net vs b/s环境下 利用socket将文件上传到服务器 不使用fileupload 控件 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 什么服务器? web 服务器? FTP 服务器? 如果是 web 服务器, 举个例子:对于 fileupload 控件, 实际生成的 html 譬如是:<form method="post" action="post.aspx" enctype="multipart/form-data">请选择上传文件:<br><input name="thefile" type="file"><br> <input name="上传" type="submit"></form>其实是 hmtl 标签 <input name="thefile" type="file"> 的作用, 浏览器负责上传文件,调用 http POST 命令, 后台向 web 服务器发送的 socket 请求为:[code=BatchFile]POST /post.aspx HTTP/1.0Referer: http://hypothetical.ora.com/clinton/upload.htmlConnection: Keep-AliveUser-Agent: Mozilla/3.01Gold (WinNT; U)Host: hypothetical.ora.comAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*Content-type: multipart/form-data; boundary=---------------------------11512135131576Content-Length: 313-----------------------------11512135131576Content-Disposition: form-data; name="done"Submit Query-----------------------------11512135131576Content-Disposition: form-data; name="thefile"; filename="c:\temp\hi.txt"Content-Type: text/plainhi there-----------------------------11512135131576--[/code]你分析一下 html 和这个请求片断, 就可以自己用 socket 来做了. asp.net是http通讯,和socket通讯是两回事。你说到socket上传只能靠C/S程序实现,或者要让客户端装一个ActiveX控件。 http 不用 socket 么, 你真搞笑 想用C#做一个东西,不知道该用什么? C#调用DLL 基于Web Service的分销系统的设计与实现 问一个简单的控件继承的问题。 c#自制控件是画一个贝塞耳曲线 PDA模拟器部署不能显示汉字?请高手指点,小女子感激不尽。 关于SQL SERVER2000数据库身份验证? 请高手帮忙:如何将Excel表导入Access数据库,前提是数据库中没有该表,需要根据导入的表自动在数据库中建立表? 这段代码在C#可以用吗? 请教一个打开注册表项的问题,请高手指点,在线等待,很急,谢谢 如何改变RichTextBox的字体 asp.net 不利用fileupload上传文件
对于 fileupload 控件, 实际生成的 html 譬如是:<form method="post" action="post.aspx" enctype="multipart/form-data">
请选择上传文件:<br>
<input name="thefile" type="file"><br>
<input name="上传" type="submit">
</form>
其实是 hmtl 标签 <input name="thefile" type="file"> 的作用, 浏览器负责上传文件,
调用 http POST 命令, 后台向 web 服务器发送的 socket 请求为:
[code=BatchFile]
POST /post.aspx HTTP/1.0
Referer: http://hypothetical.ora.com/clinton/upload.html
Connection: Keep-Alive
User-Agent: Mozilla/3.01Gold (WinNT; U)
Host: hypothetical.ora.com
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-type: multipart/form-data; boundary=--
-------------------------11512135131576
Content-Length: 313-----------------------------11512135131576
Content-Disposition: form-data; name="done"Submit Query
-----------------------------11512135131576
Content-Disposition: form-data; name="thefile"; filename="c:\temp\hi.txt"
Content-Type: text/plainhi there-----------------------------11512135131576--
[/code]你分析一下 html 和这个请求片断, 就可以自己用 socket 来做了.
http 不用 socket 么, 你真搞笑