1 XmlTextReader,XmlTextWriter

















































































2 web服务 Md5加密
using System.Web.Security;
[WebMethod]
public string HashByMd5(string str)
{
return FormsAuthentication.HashPasswordForStoringInConfigFile(str,"md5");
}
3 返回数据集 挑选单价大于多少的例子
[WebMethod]
public string HelloWorld(string name)
{
return name + ",hello";
}
[WebMethod]
public DataSet GetProducts()
{
da.Fill(ds.Products);
return ds;
}
private void btnTest_Click(object sender, System.EventArgs e)
{
MyService service=new MyService();
lbl.Text=service.HelloWorld("mike");
}
private void btnSearch_Click(object sender, System.EventArgs e)
{
MyService service=new MyService();
DataSet ds=service.GetProducts();
DataView dv=ds.Tables[0].DefaultView;
dv.RowFilter="UnitPrice>" + txtPrice.Text;
this.dgd.DataSource=dv;
this.dgd.DataBind();
}