ejder ejder

ejder ejder

  • NA
  • 1
  • 0

About Http 500 Internal Error

Feb 19 2006 2:28 PM
I am writing program.  it get the Source code of site.
for example; site.com/news.asp?id=55  I get the source code. But if I
try the get site.com/news.asp?id=55'a  or site.com/news.asp?id=55a  it
give me ERROR 500. AND the program NOT GET the Sources code. Soo in
explorer i Uncheck the SHOW FRIENDLY ERROR. so I can seee that

Microsoft OLE DB Provider for SQL Server error '80040e14'

Unclosed quotation mark before the character string 'a '.

like that. BUt in my Program I WANT to get this error Too..  In my
code. It always gooing exception.. :((


StringBuilder sb = new StringBuilder();
byte[] buf = new byte[8192];

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

try
{
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();

string tempString = null;
int count = 0;
do
{
count = resStream.Read(buf, 0, buf.Length);
if (count != 0)
{
tempString = Encoding.ASCII.GetString(buf, 0, count);
sb.Append(tempString);
}
Application.DoEvents();
}
while (count > 0);
resStream.Close();
response.Close();

if (File.Exists(dosya) == true) { File.Delete(dosya); }
StreamWriter writer = File.CreateText(dosya);
writer.WriteLine(sb.ToString());
writer.Close();
}
catch (Exception)
{
MessageBox.Show("Connection Failed !!"+url,"NO !!");
}