public static CLSObject[] ParseStringSplit(string str, string Split) { string[] strArray = str.Split(Split.ToCharArray()); CLSObject[] objArray = new CLSObject[strArray.Length]; for (int i = 0; i < strArray.Length; i++) { objArray[i] = strArray[i]; } return(objArray); }
private static decimal Helper_GetVersionDecimal(string version) { char[] separator = new char[] { '.' }; string[] strArray = version.Split(separator); if (strArray.Length != 4) { return(decimal.Zero); } CLSObject[] objArray = new CLSObject[] { strArray[0], strArray[1], strArray[2], strArray[3] }; return((((((objArray[0].ValueDecimal * 100M) * 100M) * 100000000M) + ((objArray[1].ValueDecimal * 100M) * 100000000M)) + (objArray[2].ValueDecimal * 100000000M)) + objArray[3].ValueDecimal); }
public ReturnMsgListDC ExecRequestList(string targetFile, Hashtable htbParams) { string baseUrl = DCConf.GetDCUrl(this.ProdType, this.MethodType); string url = $"{ baseUrl.TrimEnd('/')}/{targetFile}"; if (htbParams != null && htbParams.Count > 0) { List <string> lstValues = new List <string>(); foreach (string key in htbParams.Keys) { lstValues.Add($"{key}={htbParams[key]}"); } url = $"{url}?{ string.Join("&", lstValues.ToArray())}"; } HttpComm comm = new HttpComm(); Dictionary <string, string> dicRequestParams = new Dictionary <string, string>(); dicRequestParams.Add("url", url); HttpResult result = comm.ExecWebRequest(dicRequestParams); if (result.IsSucceed) { string[] strArray = result.Content.Split("\n".ToCharArray()); int code = -1; List <CLSObject[]> data = new List <CLSObject[]>(); for (int i = 0; i < strArray.Length; i++) { string[] strArray2 = strArray[i].Split(",".ToCharArray()); if ((i == 0) && (strArray2.Length >= 1)) { code = int.Parse(strArray2[0]); } CLSObject[] item = new CLSObject[strArray2.Length]; for (int j = 0; j < strArray2.Length; j++) { item[j] = strArray2[j]; } data.Add(item); } return(new DC.ReturnMsgListDC(true, result.Content, code, data)); } else { throw new Exception("请求DC发生异常", result.HttpException); } }