首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C# winform 调用 webservice返回类型处置

2013-10-01 
C# winform 调用 webservice返回类型处理。例:我要获得 cardno对应 值。webservicec#object[解决办法]obj.CA

C# winform 调用 webservice返回类型处理。


例:我要获得 cardno对应 值。 webservice c# object
[解决办法]
obj.CARDNO 取不到值吗?
[解决办法]
在Watch中看OBJECT的类型是什么?强制转换过去就能访问了。
[解决办法]
refer:

class Program
    {
        static void Main(string[] args)
        {
            Test test = new Test();
            test.CardNo = "877878";

            object obj = test;
            Type type = obj.GetType();
            Console.WriteLine(type.GetProperty("CardNo").GetValue(obj, null));//获得obj对象的CardNo属性值 877878
        }
    }

    public class Test
    {
        public string CardNo { get; set; }
    }

热点排行