在c#中的web方法中返回System.Object [英] Return System.Object in web method in c#
本文介绍了在c#中的web方法中返回System.Object的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对于某些要求,我想通过webservice(c#)中的web方法返回Sytem.Object。是否可能,如果是,那么如何以及为什么......
Hi,
For some requirements I want to return Sytem.Object by web method in webservice(c#). Is it possible or not if yes then how and why...
推荐答案
从C#中的任何方法返回的任何内容(包括Web方法)都是一个对象 - 一切都是派生自Object。
所以是的,你可以 - 只需将return参数声明为对象
但是,这并不意味着你可以在另一端使用它......
Anything you return from any method in C# (including web methods) is an Object - everything is derived from Object.
So yes, you can - just declare the return parameter to be anobject
However, that doesn't mean you will be able to use it at the other end...
http://tutorials.csharp-online.net/CSharp_Generics_Recipes%E2%80%94Understanding_Generic_Types [ ^ ]
这篇关于在c#中的web方法中返回System.Object的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文