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


C# IConnectionInfo.Decrypt方法代码示例

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


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

示例1: DallasCxForm

 public DallasCxForm(IConnectionInfo cxInfo)
 {
     this._cxInfo = cxInfo;
     this.InitializeComponent();
     this.cboServer.Text = this._cxInfo.DatabaseInfo.Server ?? "";
     this.txtDisplayName.Text = this._cxInfo.DisplayName;
     this.txtKey.Text = this._cxInfo.Decrypt((string) this._cxInfo.DriverData.Element("AccountKey"));
     if (this.txtKey.Text.Length == 0)
     {
         Repository repository = Repository.FromDisk().LastOrDefault<Repository>(r => r.DriverLoader.InternalID == "DallasAuto");
         if (repository != null)
         {
             string str = (string) repository.DriverData.Element("AccountKey");
             if (!string.IsNullOrEmpty(str))
             {
                 this._lastKey = cxInfo.Decrypt(str);
             }
         }
     }
     this.llCopyLast.Enabled = !string.IsNullOrEmpty(this._lastKey);
     string[] names = MRU.DallasUriNames.GetNames();
     if (this.cboServer.Text.Length == 0)
     {
         this.cboServer.Text = (names.Length == 0) ? "https://" : names[0];
         this.chkRemember.Checked = true;
     }
     this.cboServer.Items.AddRange(names);
     this.chkRemember.Checked = this._cxInfo.Persist;
     try
     {
         this.lblWarning.Font = new Font(this.Font, FontStyle.Bold);
     }
     catch
     {
     }
     this.panWarning.Dispose();
     this.EnableControls();
 }
开发者ID:CuneytKukrer,项目名称:TestProject,代码行数:38,代码来源:DallasCxForm.cs

示例2: InitializeContext

 internal static void InitializeContext(IConnectionInfo r, object context, bool dallas)
 {
     DataServiceContext context2 = (DataServiceContext) context;
     context2.ResolveType = name => Type.GetType("LINQPad.User." + name.Split(new char[] { '.' }).Last<string>());
     if (dallas)
     {
         string str = (string) r.DriverData.Element("AccountKey");
         if (!string.IsNullOrEmpty(str))
         {
             str = r.Decrypt(str);
         }
         if (!string.IsNullOrEmpty(str))
         {
             context2.Credentials = new NetworkCredential("accountkey", str);
         }
     }
     else if (r.DatabaseInfo.UserName.Length > 0)
     {
         context2.Credentials = new NetworkCredential(r.DatabaseInfo.UserName, r.DatabaseInfo.Password);
     }
     else
     {
         context2.Credentials = CredentialCache.DefaultNetworkCredentials;
     }
     context2.SendingRequest += delegate (object sender, SendingRequestEventArgs e) {
         WebProxy webProxy = Util.GetWebProxy();
         if (webProxy != null)
         {
             e.Request.Proxy = webProxy;
         }
         DataContextBase.SqlLog.WriteLine(e.Request.RequestUri);
     };
 }
开发者ID:CuneytKukrer,项目名称:TestProject,代码行数:33,代码来源:AstoriaHelper.cs

示例3: Load

        public static RavenConnectionDialogViewModel Load(IConnectionInfo cxInfo)
        {
            var xe = cxInfo.DriverData.Element(RavenConnectionInfoKey);
            if (xe == null) return null;
            var json = xe.Value;
            var rvnConn = JsonConvert.DeserializeObject<RavenConnectionDialogViewModel>(json);
            rvnConn.CxInfo = cxInfo;

            if (!string.IsNullOrWhiteSpace(rvnConn.Password))
                rvnConn.Password = cxInfo.Decrypt(rvnConn.Password);

            return rvnConn;
        }
开发者ID:toftware,项目名称:RavenDB-Linqpad-Driver,代码行数:13,代码来源:RavenConnectionDialogViewModel.cs


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