Пример #1
0
        private HttpClient CreateClient(string content)
        {
            var client = new HttpClient()
            {
                BaseAddress = new Uri(OASISServiceURL)
            };
            var thisepoch = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
            var reqsecret = "";

            using (HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(APIKey)))
            {
                var hashData = Encoding.UTF8.GetBytes(string.Format("{0}:{1}:{2}:{3}{4}"
                                                                    , ApplicationID
                                                                    , thisepoch
                                                                    , ApplicationKey
                                                                    , content
                                                                    , (!string.IsNullOrEmpty(RemoteIP) ? ":" + RemoteIP : "")));
                var hmacHash = hmac.ComputeHash(hashData);
                reqsecret = Convert.ToBase64String(hmacHash);
            }

            client.DefaultRequestHeaders.Add("X-OASIS-EPOCH", thisepoch.ToString());
            client.DefaultRequestHeaders.Add("X-OASIS-APPID", ApplicationID.ToString());
            client.DefaultRequestHeaders.Add("X-OASIS-REQSECRET", reqsecret);
            if (!string.IsNullOrEmpty(RemoteIP))
            {
                client.DefaultRequestHeaders.Add("X-OASIS-IP", RemoteIP);
            }

            return(client);
        }
Пример #2
0
    protected override void CurrentTool_ItemCommand(object sender, WTF.Controls.MyCommandEventArgs e)
    {
        switch (e.CommandName)
        {
        case "Remove":
            objLogRule.loger_loging.DeleteDataPrimaryKey(gdvContent.SelectedRowDataKeys);
            RenderPage();
            break;

        case "LogClear":

            Redirect("LogClear.aspx?ApplicationID=" + ApplicationID.ToString());
            break;

        case "SaveSet":
            Redirect("WriterTypeEdit.aspx?ApplicationID=" + ApplicationID.ToString());
            break;

        case "LogStat":
            Redirect("LogStatList.aspx?ApplicationID=" + ApplicationID.ToString());
            break;

        case "Search":
            SearchCondition();
            break;
        }
    }
Пример #3
0
 public UserLog(string _username, ApplicationID _applicationID, Tag _tag)
 {
     username = _username;
     applicationId = _applicationID.ToString();
     tag =_tag.ToString();
     timestamp = (long)UnityEngine.Time.realtimeSinceStartup;//System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fff");
     //		timeServer = System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz");
     //timestamp = System.BitConverter.GetBytes(System.DateTime.Now.ToBinary());
     //timestamp = System.DateTime.Now.ToBinary();
 }
Пример #4
0
    protected override void CurrentContent_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        switch (e.CommandName)
        {
        case "Remove":
            objLogRule.loger_operationloging.DeleteDataPrimaryKey(e.CommandArgument.ToString());
            RenderPage();
            break;

        case "Detail":
            RedirectState("OperationLogInfo.aspx?OperationID=" + e.CommandArgument.ToString() + "&ApplicationID=" + ApplicationID.ToString());
            break;
        }
    }
 public GetRoutine requestSuggestion(string character,ApplicationID game)
 {
     next_activity_query = server.requestNextActivity(userID, character,game.ToString());
     return next_activity_query;
 }
 public GetRoutine requestSuggestion(int languageArea,int difficulty,ApplicationID game)
 {
     next_activity_query = server.requestNextActivity(userID, languageArea, difficulty,game.ToString());
     return next_activity_query;
 }