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); }
/// <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); }
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()); }
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()); }