读书人

求回来xml格式的代码

发布时间: 2012-12-30 10:43:15 作者: rapoo

求返回xml格式的代码
终端用GetRule(string strmeid)这个接口,这个接口以xml的形式返回所需要的数据


<Table diffgr:id="Table1" msdata:rowOrder="0">
<ID>661</ID>
<IP>202.96.172.232</IP>
<PORT>10041</PORT>
</Table>


我是新手,求打样儿代码
[解决办法]
GetRule返回string就行了, GetRule内部你组织成xml格式的字符串,接收方直接用xmldocument读取就行了
[解决办法]
楼主是什么意思啊?都没怎么看懂啊
贴个代码 给你看看吧
public XElement GetRule(string strmeid)
{
XElement x=XElement.Parse(" <Table diffgr:id=\"Table1\" msdata:rowOrder=\"0\">"
+"<ID>661</ID>"
+"<IP>202.96.172.232</IP>"
+"<PORT>10041</PORT>"
+"</Table>");

return x;
}

读书人网 >Web Service

热点推荐