博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

模拟form提交

Posted on 2012-08-01 15:35  xgbzsc  阅读(134)  评论(0编辑  收藏  举报

using   System; 
using   System.Collections; 
using   System.Net; 
using   System.Collections.Specialized; 

public   class   MyClass 

public   static   void   Main() 

WebClient   a   =   new   WebClient();   
NameValueCollection   na   =   new   NameValueCollection();   
na.Add( "Account ", "横刀夺爱 ");   
na.Add( "PassPhrase ", "123456 ");   
na.Add( "Payee_Account ", "2654824 ");   
na.Add( "Amount ", "0.01 ");   
na.Add( "PAY_IN ", "1 ");   
na.Add( "WORTH_OF ", "Gold ");   
na.Add( "Memo ", "just   test ");   
na.Add( "IGNORE_RATE_CHANGE ", "Y ");   
byte   []   ss   =   a.UploadValues( "http://localhost/TestAspx/WebClient_Test.ASPX ", "POST ",na);   
Console.ReadLine(); 


}