110,561
社区成员
发帖
与我相关
我的任务
分享
[XmlInclude(typeof(WebResEntity))]
[WebMethod]
public string AddData(WebResEntity Res)
{
try
{
// ...........
//..........
return string.Empty;
}
catch (Exception ex)
{
return ex.Message;
}
}
// [XmlInclude(typeof(WebResEntity))]
[WebMethod]
public string AddData<T>(T Res)
{
try
{
// ...........
//..........
return string.Empty;
}
catch (Exception ex)
{
return ex.Message;
}
}
struct myinfo
{
public string name;
public int id;
}
private void button1_Click(object sender, EventArgs e)
{
aa<int,string>(1,"2");
aa<string, string>("1", "2");
myinfo info1,info2;
info1.id=1;
info1.name = "1";
info2.id=2;
info2.name = "2";
aa<myinfo,myinfo>(info1,info2);
}
private void aa<T1,T2>(T1 t1, T2 t2)
{
}