~~很受伤~~:
webService返回一个dataSet,~~客户端没有问题~~,不过确遇到401错误~~艾解决方法如下
private void button1_Click(object sender, System.EventArgs e)
{
try
{
localhost.Service1 l=new localhost.Service1();
l.Credentials=System.Net.CredentialCache.DefaultCredentials;//应付401错误(痛苦查找3个小时后~~晕菜)
DataSet d=l.HelloWorld();
dataGrid1.DataSource=d.Tables[0];
MessageBox.Show("aa");
//MessageBox.Show(l.SayHello("1","2").Length.ToString());
}
catch(Exception e1)
{
MessageBox.Show(e1.ToString());
}
//MessageBox.Show();
}
}
~~仅供参考~~谢谢
webService返回一个dataSet,~~客户端没有问题~~,不过确遇到401错误~~艾解决方法如下
private void button1_Click(object sender, System.EventArgs e)
{
try
{
localhost.Service1 l=new localhost.Service1();
l.Credentials=System.Net.CredentialCache.DefaultCredentials;//应付401错误(痛苦查找3个小时后~~晕菜)
DataSet d=l.HelloWorld();
dataGrid1.DataSource=d.Tables[0];
MessageBox.Show("aa");
//MessageBox.Show(l.SayHello("1","2").Length.ToString());
}
catch(Exception e1)
{
MessageBox.Show(e1.ToString());
}
//MessageBox.Show();
}
}
~~仅供参考~~谢谢