示例#1
0
        public string GetString(HttpRequest request)
        {
            CString strmContents = string.Empty;

            using (System.IO.StreamReader reader = new System.IO.StreamReader(request.InputStream))
            {
                while (reader.Peek() >= 0)
                {
                    strmContents += reader.ReadToEnd();
                }
            }
            return(strmContents);
        }
示例#2
0
        /// <summary>
        /// This method takes an HttpWebResponse as parameter and returns string from its content
        /// </summary>
        /// <param name="response"></param>
        /// <returns></returns>
        public string GetString(HttpWebResponse response)
        {
            CString strmContents = string.Empty;

            using (System.IO.StreamReader reader = new System.IO.StreamReader(response.GetResponseStream()))
            {
                while (reader.Peek() >= 0)
                {
                    strmContents += reader.ReadToEnd();
                }
            }

            return(strmContents);
        }
示例#3
0
        public string FormatCobolDate(string strVal, int intLen)
        {
            CString r = string.Empty;

            strVal = strVal.Replace("-", "");
            strVal = strVal.Replace("/", "");
            strVal = strVal.Replace(".", "");
            strVal = SetValue(strVal, 8);

            r += VB.Right(strVal, 4);     //gets year
            r += VB.mid(strVal, 1, 2);    //gets month
            r += VB.mid(strVal, 3, 2);    //gets date


            return(r.ToString());
        }
示例#4
0
        public string FormatCobolDate(string strVal, int intLen)
        {
            string  strDate;
            CString r = string.Empty;

            if (string.IsNullOrEmpty(strVal))
            {
                //FormatCobolDate = SetValue(strVal,intLen)
            }
            else
            {
                strVal = strVal.Replace("-", ""); //Replace(strVal,"-","")
                strVal = strVal.Replace("/", ""); //Replace(strVal,"/","")
                strVal = strVal.Replace(".", ""); //Replace(strVal,".","")
                strVal = SetValue(strVal, 8);     //SetValue(strVal,8)

                //r = Right(strVal, 4) & Mid(strVal, 1, 2) & Mid(strVal, 3, 2);

                r += VB.Right(strVal, 4);  //gets year
                r += VB.mid(strVal, 1, 2); //gets month
                r += VB.mid(strVal, 3, 2); //gets date
            }
            return(r.ToString());
        }