예제 #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());
        }