feixin

   #region
            //static object sdk;
            //static Assembly asm;
            //[STAThread]
            //static void Main(string[] args)
            //{
            //    // 载入程序集
            //    //asm = Assembly.LoadFrom(@"Fetion SDK.dll");
            //    asm=Assembly.LoadFrom(@"D:\work\Fetion SDK.dll"); 

            //    // 获取Fetion SDK的类型
            //    Type type = Invoker.GetType(asm, "com.hetaoos.FetionSDK.FetionSDK");
            //    // 实例化sdk
            //    sdk = Invoker.CreateInstance(type);
            //    // 获取账号管理的属性
            //    object accountManager = Invoker.GetProperty(sdk, "AccountManager");
            //    // 设置用户名和密码
            //    Invoker.CallMethod(accountManager, "FillUserIdAndPassword", new object[] { "13661766147", "gongyi", false });
            //    // 监听事件
            //    Invoker.AddEventHandler(sdk, "SDK_UserSatusChange", Invoker.GetMethod(typeof(Program), "sdk_SDK_UserSatusChange"), null);
            //    // 调用登录方法
            //    Invoker.CallMethod(accountManager, "Login");
            //}
            //static void Hello()
            //{
            //    Console.WriteLine("hello in Hello");
            //}

            //static void sdk_SDK_UserSatusChange(object sender, EventArgs e)
            //{

            //    Console.WriteLine(Invoker.GetProperty(e, "NewStatus"));
            //    Console.WriteLine(Invoker.GetSaticField(Invoker.GetType(asm, "Imps.Client.UserAccountStatus"), "Logon"));
            //    // 这里用==不好使,要用Equals,不知道为什么
            //    if (Invoker.GetProperty(e, "NewStatus").Equals(Invoker.GetSaticField(Invoker.GetType(asm, "Imps.Client.UserAccountStatus"), "Logon")))
            //    {
            //        Console.WriteLine("hello");
            //        object contactControl = Invoker.GetProperty(sdk, "ContactControl");
            //        object sendSMS = Invoker.GetProperty(contactControl, "SendSMS");
            //        Invoker.CallMethod(sendSMS, "SendSMS", "13297093329", "hello, a test");
            //    }
            //}


            #endregion
posted @ 2009-06-29 14:52  paymob  阅读(339)  评论(0编辑  收藏  举报