- 博客(0)
- 资源 (1)
空空如也
深圳社保查询
深圳社保查询 wiform 访问网页
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
// Fly.WebLogo.UrlLogoin login = new Fly.WebLogo.UrlLogoin();
private void button1_Click(object sender, EventArgs e)
{
string url = "http://www.dygjj.gov.cn/huiyuan/queryresult.asp";
if (string.IsNullOrEmpty(this.txtID.Text.Trim()))
{
MessageBox.Show("身证不能为空");
this.txtID.Focus();
return;
}
else if (string.IsNullOrEmpty(this.txtComputer.Text.Trim()))
{
MessageBox.Show("电脑号不能为空");
this.txtComputer.Focus();
return;
}
// else if (string.IsNullOrEmpty(this.txtCode.Text.Trim()))
// {
// MessageBox.Show("验证码不能为空");
// this.txtCode.Focus();
// return;
// }
//string url = "http://wssb2.szsi.gov.cn/NetApplyWeb/personacctoutResult.jsp";
string post = string.Format("ShenFenZ={0}&XingMing;={1}&CxType=1", this.txtID.Text, this.txtComputer.Text);
oneData = Encoding.Default.GetBytes(post);
Uri uri = new Uri(url);
myHttpWebRequest = (HttpWebRequest)WebRequest.Create(uri);//请求的URL
myHttpWebRequest.CookieContainer = Cookies;//*发送COOKIE
myHttpWebRequest.Method = "POST";
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";
myHttpWebRequest.ContentLength = oneData.Length;
Stream newMyStream = myHttpWebRequest.GetRequestStream();
newMyStream.Write(oneData, 0, oneData.Length);
try
{
HttpWebResponse response = (HttpWebResponse)myHttpWebRequest.GetResponse();
StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.Default);
string str = sr.ReadToEnd();
string msg = string.Empty;
if (!Test(str, out msg))
{
this.lblResult.Text = msg;
}
else
{
2012-08-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人