コード例 #1
0
ファイル: ScoroCode.cs プロジェクト: DiegoV71/ScoroNet
 private ScoroCode(string appKey, string clientKey, string accessKey)
 {
     AuthKey = new SCAuthKey
     {
         AppKey    = appKey,
         ClientKey = clientKey,
         AccessKey = accessKey
     };
 }
コード例 #2
0
 public SCAppResponse TryGetAppInfo(SCAuthKey keys)
 {
     try
     {
         return(GetAppInfo(keys));
     }
     catch (WebException ex)
     {
         return((SCAppResponse)RequestExceptionHelper.FillRequestError(ex));
     }
 }
コード例 #3
0
 public SCResponse TryLogout(SCAuthKey keys, string sessionId)
 {
     try
     {
         return(Logout(keys, sessionId));
     }
     catch (WebException ex)
     {
         return(RequestExceptionHelper.FillRequestError(ex));
     }
 }
コード例 #4
0
 public SCLoginResponse <T> TryLogin <T>(SCAuthKey keys, string email, string password) where T : SCUserInfo
 {
     try
     {
         return(Login <T>(keys, email, password));
     }
     catch (WebException ex)
     {
         return((SCLoginResponse <T>)RequestExceptionHelper.FillRequestError(ex));
     }
 }
コード例 #5
0
 public SCResponse TryRegister <T>(SCAuthKey keys, string userName, string email, string password, T additionalInfo = default(T))
 {
     try
     {
         return(Register(keys, userName, email, password, additionalInfo));
     }
     catch (WebException ex)
     {
         return(RequestExceptionHelper.FillRequestError(ex));
     }
 }
コード例 #6
0
        protected SCResponse Logout(SCAuthKey keys, string sessionId)
        {
            var url = Host + "/logout";

            var values = new Dictionary <string, string>();

            values.Add("app", keys.AppKey);
            values.Add("cli", keys.ClientKey);
            values.Add("sess", sessionId);

            return(RequestHelper.Get <SCResponse>(url, values));
        }
コード例 #7
0
        protected SCAppResponse GetAppInfo(SCAuthKey keys)
        {
            var url = Host + "/app";

            var values = new Dictionary <string, string>();

            values.Add("app", keys.AppKey);
            values.Add("cli", keys.ClientKey);
            values.Add("acc", keys.AccessKey);

            return(RequestHelper.Get <SCAppResponse>(url, values));
        }
コード例 #8
0
        protected SCLoginResponse <T> Login <T>(SCAuthKey keys, string email, string password) where T : SCUserInfo
        {
            var url = Host + "/login";

            var values = new Dictionary <string, string>();

            values.Add("app", keys.AppKey);
            values.Add("cli", keys.ClientKey);
            values.Add("email", email);
            values.Add("password", password);

            return(RequestHelper.Get <SCLoginResponse <T> >(url, values));
        }
コード例 #9
0
        protected SCResponse Register <T>(SCAuthKey keys, string userName, string email, string password, T additionalInfo = default(T))
        {
            var url = Host + "/register";

            var values = new Dictionary <string, string>();

            values.Add("app", keys.AppKey);
            values.Add("cli", keys.ClientKey);
            values.Add("acc", keys.AccessKey);
            values.Add("username", userName);
            values.Add("email", email);
            values.Add("password", password);
            //values.Add("doc", "{}"); //fix

            return(RequestHelper.Get <SCResponse>(url, values));
        }