예제 #1
0
        private string getToken(string apiPassword, ref bool token)
        {
            var    strJson  = ExcelFunctionController.KABUSUTE_API_TOKEN(apiPassword);
            string response = "";

            try
            {
                var objectJson = DynamicJson.Parse(strJson);

                if (objectJson.IsDefined("ResultCode"))
                {
                    if (objectJson.ResultCode == 0)
                    {
                        token = true;
                        return(objectJson.Token);
                    }
                    else
                    {
                        token = false;
                        MessageBox.Show("不明なエラーです");
                    }
                }
                else if (objectJson.IsDefined("Code"))
                {
                    token = false;
                    MessageBox.Show("Code " + objectJson.Code + ":" + objectJson.Message);
                }
            }
            catch (Exception exception)
            {
                if (exception.InnerException == null)
                {
                    MessageBox.Show(strJson);
                }
                else
                {
                    MessageBox.Show(exception.InnerException.ToString());
                }
            }

            return(response);
        }
예제 #2
0
 private string GetRTD()
 {
     return(ExcelFunctionController.ReturnWebSocketData());
 }