private string[] contentEntry; public void Button1_Click (object sender, System.EventArgs e) { int varByteCount = Request.TotalBytes; string sString=""; //contentEntry.Add ("IN"); Response.Write ("<BR> varByteCount = " + varByteCount.ToString()); Response.Write ("<BR>"); byte[] data = Request.BinaryRead(varByteCount); //iPos = InStrB(1, vData, ChrB(13) & ChrB(10)) for (int i = 1; i < varByteCount; i++) { try { if( data[i] == 10 ) { Response.Write ("<br>GOT NL (10) at i = " + i.ToString() + "<Br> "); Response.Write ("****" + data[i].ToChar() + "****<Br> "); } if( data[i] == 13 ) { Response.Write ("<br>GOT CR (13) at i = " + i.ToString() + "<Br> "); Response.Write ("****" + data[i].ToChar() + "****<Br> "); } if( data[i] == 32 ) { Response.Write ("<br>GOT SPACE (32)at i = " + i.ToString() + "<Br> "); } if (data[i] != 13 && data[i] != 10 && data[i] != 32) { Response.Write ("<br>" + data[i].ToChar() + " at i = " + i.ToString()); } sString += data[i].ToChar(); } catch (Exception ex) { } } //Response.Write("<BR><P><P> OUTPUT BYTE STRING = " + data.ToString() ); Response.Write("<BR><P><P> OUTPUT STRING = " + sString); Response.Write("<BR><P><P>"); // find start of first Content... int istart = sString.IndexOf("\r\nContent" ); int iend = sString.Length; int iStartPos = istart+3; int iEndPos = iStartPos; int iii=0; while (iEndPos > 0) { iStartPos = sString.IndexOf("\r\nContent-Disposition:",iStartPos+3); if (iStartPos > 0) { iEndPos = sString.IndexOf("\r\nContent-Disposition:",iStartPos+3); } if (iStartPos >0 && iEndPos >0) { // got a Content Entry // Response.Write ("<Br>s =*" + sString.Substring(iStartPos+2,iEndPos-iStartPos)); contentEntry[iii] = sString.Substring(iStartPos+2,iEndPos-iStartPos); } else { //Got the last Content Entry //Response.Write ("<Br>s =*" + sString.Substring(iStartPos+2,iend-(iStartPos+3))); contentEntry[iii] = sString.Substring(iStartPos+2,iend-(iStartPos+3)); } iii++; if (iii>20) { break; } } // while (iPos > 0) // { //contentEntry[iii] = sString.Substring(1,iPos); //Response.Write ("<Br>s = " + sString.Substring(1,iPos)); // iPos = sString.IndexOf("\r\nContent",iPos+11); // } //iPos = InStrB(1, vData, ChrB(13) & ChrB(10)) } 1
Hosted by www.Geocities.ws