【发布时间】:2016-01-27 08:03:37
【问题描述】:
我想用c#编写简单的web服务返回到用户数组对象字符串,在服务器web服务中写下这段代码:
public string[] mymethod()
{
string [] mytemp=new string[10];
for(int i=0;i<10;i++){
mytemp[i]=i+1.toString();
}
return mytemp;
}
但我想退货:
<myMethodResult>
<string>
<name>user1</name>
</string>
<string>
<name>user2</name>
</string>
<string>
<name>user3</name>
</string>
</myMethodResult>
【问题讨论】:
-
您使用的是什么网络服务? ASP.NET Web API? WCF? ASMX?
-
@BonMacalindong 我使用 asmx。
标签: c# asp.net asp.net-mvc web-services