All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
Asp.net
javascript函数,判断数字的合法性_JavaScript技术_编程技术
asp.net,局域网存放文件_[Asp.Net教程]
在ASP.NET程序中值得注意的两个地方_[Asp.Net教程]
.Net,Framework3.0,实践纪实之布局_[Asp.Net教程]
如何把ACCESS转成SQL数据库_[SQL,Server教程]
javascript代码格式化和语法着色_JavaScript技术_编程技术
ASP.NET,2.0,页面状态持续程序实例_.net资料_编程技术
GridView列数字、货币和日期的显示格式_[Asp.Net教程]
IIS同一站点下aps.net,1.1与2.0,共存方法_[Asp.Net教程]
Reading number is top 10 pictures
Shandong jinan is about to dismantle a one hundred-year history of the building
大人物的礼物
Players in the eyes of a perfect love1
奇趣的世界记录1
教你22句话
In the world the most mysterious 21 place landscape3
Take you to walk into the most true north Korea rural1
Embarrassing things comic collection1
美女挤公交
NeedWallpaper4
Download software ranking
Tram sex maniac 2 (H) rar bag6
在线棋牌游戏3.05版
VC++6.0培训教程
Boxer vs Yellow4
The Bermuda triangle2
Take off clothes to survival
美女写真3
Twenty piece of palm leaf
Boxer Classic video1
圣殿祭司的ASP.NET.2.0.开发详解-使用C#
delv published in(发表于) 2014/1/6 9:05:18 Edit(编辑)
ASPX接收WINDOWS应用程序以POST方式发来的信息并存成文件_[Asp.Net教程]

ASPX接收WINDOWS应用程序以POST方式发来的信息并存成文件_[Asp.Net教程]

ASPX接收WINDOWS应用程序以POST方式发来的信息并存成文件_[Asp.Net教程]

我这个笨蛋终于调出来了。。。不要问我调出了啥,都写在标题上了。。。。
赶紧写下来,然后睡觉。。。。


目前已经尝试了ASP,JS,C++,C#,前三个都有数月甚至数年的经验了,争取把最后一个也搞大。。。。


接下来搞啥?


切入正题。。。


Windows端应用程序


1,首先建立两个POST变量,这两个POST变量模拟ASP中的Form的name~~~(我瞎试的,果然是模拟form)



System.Net.WebClient WebClientObj=new System.Net.WebClient();
System.Collections.Specialized.NameValueCollection PostVars=new System.Collections.Specialized.NameValueCollection();
PostVars.Add("c",textBox2.Text);
PostVars.Add("b",textBox3.Text);
//textBox2.Text里面存的是要POST的信息哈


2,然后传送给一个网页:http://www.dc9.cn/t/default.aspx


try
{
byte[] byRemoteInfo=WebClientObj.UploadValues("http://www.dc9.cn/t/default.aspx","POST",PostVars);
//下面都没用啦,就上面一句话就可以了
string sRemoteInfo=System.Text.Encoding.Default.GetString(byRemoteInfo);
//这是获取返回信息
textBox1.Text=sRemoteInfo;
axDHTMLEdit1.DocumentHTML=sRemoteInfo;
//下面用了COM组件WebBrowser,让他显示返回信息,没什么用,可以不看。
object url="about:blank";
object nothing=System.Reflection.Missing.Value;
this.axWebBrowser1.Navigate2(ref url,ref nothing,ref nothing,ref nothing,ref nothing);
((mshtml.IHTMLDocument2)this.axWebBrowser1.Document).write(sRemoteInfo);
}
catch
{}



WEB端应用程序


1,在Page_Load里写


string MyText=System.Web.HttpContext.Current.Request.Form["c"];
string MyText2=System.Web.HttpContext.Current.Request.Form["b"];
//获取两个POST来的信息
StreamWriter sw=new StreamWriter(Server.MapPath(".")+"\\1.shtml", true, Encoding.UTF8);
sw.Write(MyText);
sw.Write(MyText2);
sw.Close();
//true的意思就是以append的方式写入POST来的信息



恩,就写到这里。


不知道用这种方法写文件是不是比FSO和AdodB.stream效率高占用cpu小,还希望高人指导!


来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.