当前位置: 首页>>代码示例>>C#>>正文


C# Connector.Close方法代码示例

本文整理汇总了C#中Connector.Close方法的典型用法代码示例。如果您正苦于以下问题:C# Connector.Close方法的具体用法?C# Connector.Close怎么用?C# Connector.Close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Connector的用法示例。


在下文中一共展示了Connector.Close方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main(string[] args)
        {
            //
            // TODO: Add code to start application here
            //
            if (args.Length != 2)
            {
                Console.WriteLine("Wrong number of arguments. Got {0} instead.", args.Length);
                return;
            }

            MyHandler myH = new MyHandler();
            Parameters p = new Parameters();
            p.ServerUrl = args[0];

            Connector c = new Connector();
            if (c.Open(p))
            {
                Message m = new Message();
                m.Set("do_method", "notify");
                m.Set("kn_to", args[1]);
                m.Set("kn_payload", "Hello");
                m.Set("nickname", "dotnet");
                m.Set("kn_response_format", "simple");

                c.Publish(m, myH);

                c.Close();
            }
        }
开发者ID:kragen,项目名称:mod_pubsub,代码行数:30,代码来源:Class1.cs

示例2: Main

 static void Main(string[] args)
 {
     Console.WriteLine("HelloEEG!");
     Connector connector = new Connector();
     connector.DeviceConnected += new EventHandler(OnDeviceConnected);
     connector.DeviceConnectFail += new EventHandler(OnDeviceFail);
     connector.DeviceValidating += new EventHandler(OnDeviceValidating);
     connector.ConnectScan("COM13");
     Thread.Sleep(450000);
     System.Console.WriteLine("Goodbye.");
     connector.Close();
     Environment.Exit(0);
 }
开发者ID:andrehendriks,项目名称:EEG-EEG,代码行数:13,代码来源:Program.cs

示例3: Main

        public static void Main(string[] args)
        {
            Console.WriteLine("HelloEEG!");

            // Initialize a new Connector and add event handlers

            connector = new Connector();
            connector.DeviceConnected += new EventHandler(OnDeviceConnected);
            connector.DeviceConnectFail += new EventHandler(OnDeviceFail);
            connector.DeviceValidating += new EventHandler(OnDeviceValidating);

            // Scan for devices across COM ports
            // The COM port named will be the first COM port that is checked.
            connector.ConnectScan("COM40");

            // Blink detection needs to be manually turned on
            connector.setBlinkDetectionEnabled(true);
            Thread.Sleep(450000);

            System.Console.WriteLine("Goodbye.");
            connector.Close();
            Environment.Exit(0);
        }
开发者ID:zhangziran-ucb,项目名称:MindSurf,代码行数:23,代码来源:HelloEEG.cs

示例4: button_disconnect_Click

 private void button_disconnect_Click(object sender, RoutedEventArgs e)
 {
     Connector connector = new Connector();
     connector.Close();
 }
开发者ID:andrehendriks,项目名称:MyThinkGear1,代码行数:5,代码来源:MainWindow.xaml.cs


注:本文中的Connector.Close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。