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


C# ClientConfiguration.Save方法代码示例

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


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

示例1: ShouldBeAbleToSaveTheConfigurationToFile

 public void ShouldBeAbleToSaveTheConfigurationToFile()
 {
     ClientConfiguration configuration = new ClientConfiguration();
     configuration.Save(configurationFileName);
     Assert.IsTrue(File.Exists(configurationFileName));
     File.Delete(configurationFileName);
 }
开发者ID:jskswamy,项目名称:ConsoleMailer,代码行数:7,代码来源:ClientConfigurationTest.cs

示例2: ShouldBeAbleToLoadThePropertiesBackFromXml

        public void ShouldBeAbleToLoadThePropertiesBackFromXml()
        {
            ClientConfiguration expected_configuration = new ClientConfiguration() { UserName = "user", Password = "password", Host = "smtp.google.com", Port = 445, Ssl = true };
            expected_configuration.Save(configurationFileName);
            ClientConfiguration configuration = ClientConfiguration.Create(configurationFileName);

            Assert.AreEqual(expected_configuration.UserName, configuration.UserName);
            Assert.AreEqual(expected_configuration.Password, configuration.Password);
            Assert.AreEqual(expected_configuration.Host, configuration.Host);
            Assert.AreEqual(expected_configuration.Port, configuration.Port);
            Assert.AreEqual(expected_configuration.Ssl, configuration.Ssl);
            File.Delete(configurationFileName);
        }
开发者ID:jskswamy,项目名称:ConsoleMailer,代码行数:13,代码来源:ClientConfigurationTest.cs

示例3: Init

        public static M3ClientInitializationStatus Init()
        {
            //Берём из реестра данные о соединении и сборке
            configuration = new ClientConfiguration();
            //Сохраняем в реестре новую версию сборки
            configuration.Build = ClientConfiguration.DefaultBuild;
            configuration.Save();
            //Интернационализация
            i8n.Init();
            i8n.strings.SetLanguage(configuration.Language);

            web = new RfidWebClient(configuration);

            try
            {
                reader = new CAENRFIDReader();
                reader.Connect(CAENRFIDPort.CAENRFID_RS232, "MOC1");
                System.Threading.Thread.Sleep(500);
                M3Client.source = M3Client.reader.GetSources()[0];
            }
            catch (CAENRFIDException e)
            {
                return M3ClientInitializationStatus.ReaderNotReady;
            }

            if (configuration.Server == String.Empty || configuration.DeviceKey == String.Empty)
            {
                return M3ClientInitializationStatus.ClientConfigurationMissing;
            }

            return M3ClientInitializationStatus.Ok;
        }
开发者ID:Abitech,项目名称:m3o,代码行数:32,代码来源:M3Client.cs


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