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


C# IAppSettings.GetString方法代码示例

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


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

示例1: YandexAuthProvider

 public YandexAuthProvider(IAppSettings appSettings)
     : base(appSettings, Realm, Name, "AppId", "AppPassword")
 {
     ApplicationId = appSettings.GetString("oauth.Yandex.AppId");
     ApplicationPassword = appSettings.GetString("oauth.Yandex.AppPassword");
     AccessTokenUrl = TokenUrl;
 }
开发者ID:jin29neci,项目名称:ServiceStack,代码行数:7,代码来源:YandexAuthProvider.cs

示例2: GithubAuthProvider

 public GithubAuthProvider(IAppSettings appSettings)
     : base(appSettings, Realm, Name, "ClientId", "ClientSecret")
 {
     ClientId = appSettings.GetString("oauth.github.ClientId");
     ClientSecret = appSettings.GetString("oauth.github.ClientSecret");
     Scopes = appSettings.Get("oauth.github.Scopes", new[] { "user" });
 }
开发者ID:vebin,项目名称:soa,代码行数:7,代码来源:GithubAuthProvider.cs

示例3: FourSquareOAuth2Provider

        public FourSquareOAuth2Provider(IAppSettings appSettings)
            : base(appSettings, Realm, Name)
        {
            this.AuthorizeUrl = this.AuthorizeUrl ?? Realm;
            this.AccessTokenUrl = this.AccessTokenUrl ?? "https://foursquare.com/oauth2/access_token";
            this.UserProfileUrl = this.UserProfileUrl ?? "https://api.foursquare.com/v2/users/self";

            // https://developer.foursquare.com/overview/versioning
            DateTime versionDate;
            if (!DateTime.TryParse(appSettings.GetString("oauth.{0}.Version".Fmt(Name)), out versionDate)) 
                versionDate = DateTime.UtcNow;

            // version dates before June 9, 2012 will automatically be rejected
            if (versionDate < new DateTime(2012, 6, 9))
                versionDate = DateTime.UtcNow;
            
            this.Version = versionDate;

            // Profile Image URL requires dimensions (Width x height) in the URL (default = 64x64 and minimum = 16x16)
            int profileImageWidth;
            if (!int.TryParse(appSettings.GetString("oauth.{0}.ProfileImageWidth".Fmt(Name)), out profileImageWidth))
                profileImageWidth = 64;

            this.ProfileImageWidth = Math.Max(profileImageWidth, 16);

            int profileImageHeight;
            if (!int.TryParse(appSettings.GetString("oauth.{0}.ProfileImageHeight".Fmt(Name)), out profileImageHeight))
                profileImageHeight = 64;

            this.ProfileImageHeight = Math.Max(profileImageHeight, 16);

            Scopes = appSettings.Get("oauth.{0}.Scopes".Fmt(Name), new[] { "basic" });
        }
开发者ID:jin29neci,项目名称:ServiceStack,代码行数:33,代码来源:FourSquareOAuth2Provider.cs

示例4: YammerAuthProvider

 /// <summary>
 /// Initializes a new instance of the <see cref="YammerAuthProvider"/> class.
 /// </summary>
 /// <param name="appSettings">
 /// The application settings (in web.config).
 /// </param>
 public YammerAuthProvider(IAppSettings appSettings)
     : base(appSettings, appSettings.GetString("oauth.yammer.Realm"), Name, "ClientId", "AppSecret")
 {
     this.ClientId = appSettings.GetString("oauth.yammer.ClientId");
     this.ClientSecret = appSettings.GetString("oauth.yammer.ClientSecret");
     this.PreAuthUrl = appSettings.GetString("oauth.yammer.PreAuthUrl");
 }
开发者ID:GDBSD,项目名称:ServiceStack,代码行数:13,代码来源:YammerAuthProvider.cs

示例5: FacebookAuthProvider

 public FacebookAuthProvider(IAppSettings appSettings)
     : base(appSettings, Realm, Name, "AppId", "AppSecret")
 {
     this.AppId = appSettings.GetString("oauth.facebook.AppId");
     this.AppSecret = appSettings.GetString("oauth.facebook.AppSecret");
     this.Permissions = appSettings.Get("oauth.facebook.Permissions", new string[0]);
 }
开发者ID:jlyonsmith,项目名称:ServiceStack,代码行数:7,代码来源:FacebookAuthProvider.cs

示例6: FacebookAuthProvider

 public FacebookAuthProvider(IAppSettings appSettings)
     : base(appSettings, Realm, Name, "AppId", "AppSecret")
 {
     this.AppId = appSettings.GetString("oauth.facebook.AppId");
     this.AppSecret = appSettings.GetString("oauth.facebook.AppSecret");
     this.Permissions = appSettings.Get("oauth.facebook.Permissions", TypeConstants.EmptyStringArray);
     this.Fields = appSettings.Get("oauth.facebook.Fields", DefaultFields);
 }
开发者ID:AVee,项目名称:ServiceStack,代码行数:8,代码来源:FacebookAuthProvider.cs

示例7: OdnoklassnikiAuthProvider

    public OdnoklassnikiAuthProvider(IAppSettings appSettings)
      : base(appSettings, Realm, Name, "ApplicationId", "SecretKey") 
    {
      ApplicationId = appSettings.GetString("oauth.Odnoklassniki.ApplicationId");
      PublicKey = appSettings.GetString("oauth.Odnoklassniki.PublicKey");
      SecretKey = appSettings.GetString("oauth.Odnoklassniki.SecretKey");

      AccessTokenUrl = TokenUrl;
    }
开发者ID:JackFong,项目名称:ServiceStack,代码行数:9,代码来源:OdnoklassnikiAuthProvider.cs

示例8: VkAuthProvider

        public VkAuthProvider(IAppSettings appSettings)
            : base(appSettings, Realm, Name, "ApplicationId", "SecureKey")
        {
            ApplicationId = appSettings.GetString("oauth.vkcom.ApplicationId");
            SecureKey = appSettings.GetString("oauth.vkcom.SecureKey");
            Scope = appSettings.GetString("oauth.vkcom.Scope");
            ApiVersion = appSettings.GetString("oauth.vkcom.ApiVersion");

            AccessTokenUrl = TokenUrl;
        }
开发者ID:jlyonsmith,项目名称:ServiceStack,代码行数:10,代码来源:VkAuthProvider.cs

示例9: MailRuAuthProvider

        public MailRuAuthProvider(IAppSettings appSettings)
            : base(appSettings, Realm, Name)
        {
            Method = appSettings.GetString($"oauth.{Name}.Method");
            Secure = appSettings.GetString($"oauth.{Name}.Secure");

            this.AuthorizeUrl = this.AuthorizeUrl ?? Realm;
            this.AccessTokenUrl = this.AccessTokenUrl ?? "https://connect.mail.ru/oauth/token";
            this.UserProfileUrl = this.UserProfileUrl ?? "https://www.appsmail.ru/platform/api";
        }
开发者ID:ServiceStack,项目名称:ServiceStack,代码行数:10,代码来源:MailRuAuthProvider.cs

示例10: TeamCityClientTests

 public TeamCityClientTests()
 {
     var fileInfo = new FileInfo("../../appsettings.txt");
     if (!fileInfo.Exists)
     {
         throw new FileNotFoundException("Missing appsettings file that provides TeamCity credentials");
     }
     Settings = new TextFileSettings("../../appsettings.txt");
     Client = new TcClient(
         Settings.GetString("ServerApiBaseUrl"),
         Settings.GetString("UserName"),
         Settings.GetString("Password"));
 }
开发者ID:ServiceStack,项目名称:CISetupWizard,代码行数:13,代码来源:TeamCityClientTests.cs

示例11: AuthProvider

        protected AuthProvider(IAppSettings appSettings, string authRealm, string oAuthProvider)
            : this()
        {
            // Enhancement per https://github.com/ServiceStack/ServiceStack/issues/741
            this.AuthRealm = appSettings != null ? appSettings.Get("OAuthRealm", authRealm) : authRealm;

            this.Provider = oAuthProvider;
            if (appSettings != null)
            {
                this.CallbackUrl = appSettings.GetString("oauth.{0}.CallbackUrl".Fmt(oAuthProvider))
                    ?? FallbackConfig(appSettings.GetString("oauth.CallbackUrl"));
                this.RedirectUrl = appSettings.GetString("oauth.{0}.RedirectUrl".Fmt(oAuthProvider))
                    ?? FallbackConfig(appSettings.GetString("oauth.RedirectUrl"));
            }
        }
开发者ID:dittodhole,项目名称:dotnet-ServiceStack,代码行数:15,代码来源:AuthProvider.cs

示例12: AppConfig

		public AppConfig(IAppSettings resources)
		{
			this.RootDirectory = resources.GetString("RootDirectory").MapHostAbsolutePath()
				.Replace('\\', Path.DirectorySeparatorChar);

			this.TextFileExtensions = resources.GetList("TextFileExtensions");
			this.ExcludeDirectories = resources.GetList("ExcludeDirectories");
		}
开发者ID:Qasemt,项目名称:ServiceStack.Examples,代码行数:8,代码来源:AppConfig.cs

示例13: RegisterLicenseFromAppSettings

 public static void RegisterLicenseFromAppSettings(IAppSettings appSettings)
 {
     //Automatically register license key stored in <appSettings/>
     var licenceKeyText = appSettings.GetString(NetStandardPclExport.AppSettingsKey);
     if (!string.IsNullOrEmpty(licenceKeyText))
     {
         LicenseUtils.RegisterLicense(licenceKeyText);
     }
 }
开发者ID:AVee,项目名称:ServiceStack,代码行数:9,代码来源:AppHostBase.NetCore.cs

示例14: OAuthProvider

        public OAuthProvider(IAppSettings appSettings, string authRealm, string oAuthProvider,
                             string consumerKeyName, string consumerSecretName)
        {
            this.AuthRealm = appSettings.Get("OAuthRealm", authRealm);

            this.Provider = oAuthProvider;
            this.RedirectUrl = appSettings.GetString("oauth.{0}.RedirectUrl".Fmt(oAuthProvider));
            this.CallbackUrl = appSettings.GetString("oauth.{0}.CallbackUrl".Fmt(oAuthProvider));
            this.ConsumerKey = appSettings.GetString("oauth.{0}.{1}".Fmt(oAuthProvider, consumerKeyName));
            this.ConsumerSecret = appSettings.GetString("oauth.{0}.{1}".Fmt(oAuthProvider, consumerSecretName));

            this.RequestTokenUrl = appSettings.Get("oauth.{0}.RequestTokenUrl".Fmt(oAuthProvider), authRealm + "oauth/request_token");
            this.AuthorizeUrl = appSettings.Get("oauth.{0}.AuthorizeUrl".Fmt(oAuthProvider), authRealm + "oauth/authorize");
            this.AccessTokenUrl = appSettings.Get("oauth.{0}.AccessTokenUrl".Fmt(oAuthProvider), authRealm + "oauth/access_token");

            this.OAuthUtils = new OAuthAuthorizer(this);
            this.AuthHttpGateway = new AuthHttpGateway();
        }
开发者ID:GDBSD,项目名称:ServiceStack,代码行数:18,代码来源:OAuthProvider.cs

示例15: OAuthProvider

        public OAuthProvider(IAppSettings appSettings, string authRealm, string oAuthProvider,
                             string consumerKeyName, string consumerSecretName)
        {
            this.AuthRealm = appSettings.Get("OAuthRealm", authRealm);

            this.Provider = oAuthProvider;
            this.RedirectUrl = appSettings.GetString($"oauth.{oAuthProvider}.RedirectUrl")
                ?? FallbackConfig(appSettings.GetString("oauth.RedirectUrl"));
            this.CallbackUrl = appSettings.GetString($"oauth.{oAuthProvider}.CallbackUrl")
                ?? FallbackConfig(appSettings.GetString("oauth.CallbackUrl"));
            this.ConsumerKey = appSettings.GetString($"oauth.{oAuthProvider}.{consumerKeyName}");
            this.ConsumerSecret = appSettings.GetString($"oauth.{oAuthProvider}.{consumerSecretName}");

            this.RequestTokenUrl = appSettings.Get($"oauth.{oAuthProvider}.RequestTokenUrl", authRealm + "oauth/request_token");
            this.AuthorizeUrl = appSettings.Get($"oauth.{oAuthProvider}.AuthorizeUrl", authRealm + "oauth/authorize");
            this.AccessTokenUrl = appSettings.Get($"oauth.{oAuthProvider}.AccessTokenUrl", authRealm + "oauth/access_token");
            this.SaveExtendedUserInfo = appSettings.Get($"oauth.{oAuthProvider}.SaveExtendedUserInfo", true);

            this.OAuthUtils = new OAuthAuthorizer(this);
            this.AuthHttpGateway = new AuthHttpGateway();
        }
开发者ID:AVee,项目名称:ServiceStack,代码行数:21,代码来源:OAuthProvider.cs


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