Пример #1
0
        public StationLogOnResponse LogOn(WebClient agent, Dictionary <object, object> param)
        {
            Dictionary <object, object> parameters = new Dictionary <object, object>(param);

            parameters.Add(CloudServer.PARAM_SESSION_TOKEN, this.Token);
            parameters.Add(CloudServer.PARAM_STATION_ID, this.Id);
            parameters.Add(CloudServer.PARAM_API_KEY, CloudServer.APIKey);

            StationLogOnResponse res =
                CloudServer.requestPath <StationLogOnResponse>(agent, "stations/logOn", parameters);

            this.Token = res.session_token;

            return(res);
        }
Пример #2
0
        public static StationLogOnResponse LogOn(WebClient agent, string stationId, string email, string passwd, StationDetail detail)
        {
            Dictionary <object, object> param = new Dictionary <object, object>
            {
                { CloudServer.PARAM_EMAIL, email },
                { CloudServer.PARAM_PASSWORD, passwd },
                { CloudServer.PARAM_STATION_ID, stationId },
                { CloudServer.PARAM_API_KEY, CloudServer.APIKey },
                { CloudServer.PARAM_DETAIL, detail.ToFastJSON() }
            };

            StationLogOnResponse res = CloudServer.requestPath <StationLogOnResponse>(agent, "stations/logOn", param);

            return(res);
        }
Пример #3
0
        public StationLogOnResponse LogOn(WebClient agent, StationDetail detail)
        {
            Dictionary <object, object> parameters = new Dictionary <object, object>
            {
                { CloudServer.PARAM_SESSION_TOKEN, this.Token },
                { CloudServer.PARAM_STATION_ID, this.Id },
                { CloudServer.PARAM_API_KEY, CloudServer.APIKey },
                { CloudServer.PARAM_DETAIL, detail.ToFastJSON() }
            };

            StationLogOnResponse res =
                CloudServer.requestPath <StationLogOnResponse>(agent, "stations/logOn", parameters);

            this.Token = res.session_token;
            return(res);
        }