Пример #1
0
        private string GetServerCookie()
        {
            if (String.IsNullOrEmpty(Config.UserName))
            {
                return("");
            }
            String postUrl = Config.CookieUrl;
            LoginInfoSyncRequest infoSyncRequest = new LoginInfoSyncRequest();

            infoSyncRequest.channelKey = Config.UserName;
            String postData = JsonConvert.SerializeObject(infoSyncRequest);
            String result   = "";

            try
            {
                result = CommonUse.Post(postUrl, postData, null, 60, "application/json", false);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("获取工号登录信息失败,请与管理员联系!\r\n\r\n({0})", ex.Message));
            }

            return(result);
        }