商業源碼熱門下載www.html.org.cn
我這個笨蛋終于調出來了。。。不要問我調出了啥,都寫在標題上了。。。。
趕緊寫下來,然后睡覺。。。。
目前已經嘗試了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(");
//下面都沒用啦,就上面一句話就可以了
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(".")+"sw.write(mytext);
sw.write(mytext2);
sw.close();
//true的意思就是以append的方式寫入post來的信息
恩,就寫到這里。
不知道用這種方法寫文件是不是比fso和adodb.stream效率高占用cpu小,還希望高人指導!
新聞熱點
疑難解答