S
Shayer
Hi,
I m trying to retreive some information from a webpage using the
following code
for(i=0;i<imageList.Count;i++)
{
saveimage:
try
{
Console.WriteLine("Trying to save image:"+imageList.ToString());
j = imageList.ToString();
WebRequest req = WebRequest.Create(j);
WebResponse res =req.GetResponse();
Stream strm = res.GetResponseStream();
BinaryReader br = new BinaryReader(strm);
long len = res.ContentLength;
Image img = Image.FromStream(strm);
img.Save(GIFFolderPath+@"\"+NewFileName);
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString());
goto saveimage;
}//try catch
}//for
Actually when i try this code in Dial Up network it works fine but
when i tried it in the client-server network like when i am connected to
internet using another server .. after retreiving first two image it hangs
up and give the following error
=======================
System.Net.WebException: The operation has timed-out.
at System.Net.HttpWebRequest.GetResponse()
at prjJLCV.SaveToDataBase.SaveImageData(ArrayList imageList, String
GIFFolder
Path, String MaxPropertyID, String PropertyID) in c:\currentworks\jlc
values\mar
ch22\jlcv_final\prjjlcv\savetodatabase.cs:line
280=========================================
i am tring this code from a windows console application
Can anyone tell me where is the problem
I m trying to retreive some information from a webpage using the
following code
for(i=0;i<imageList.Count;i++)
{
saveimage:
try
{
Console.WriteLine("Trying to save image:"+imageList.ToString());
j = imageList.ToString();
WebRequest req = WebRequest.Create(j);
WebResponse res =req.GetResponse();
Stream strm = res.GetResponseStream();
BinaryReader br = new BinaryReader(strm);
long len = res.ContentLength;
Image img = Image.FromStream(strm);
img.Save(GIFFolderPath+@"\"+NewFileName);
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString());
goto saveimage;
}//try catch
}//for
Actually when i try this code in Dial Up network it works fine but
when i tried it in the client-server network like when i am connected to
internet using another server .. after retreiving first two image it hangs
up and give the following error
=======================
System.Net.WebException: The operation has timed-out.
at System.Net.HttpWebRequest.GetResponse()
at prjJLCV.SaveToDataBase.SaveImageData(ArrayList imageList, String
GIFFolder
Path, String MaxPropertyID, String PropertyID) in c:\currentworks\jlc
values\mar
ch22\jlcv_final\prjjlcv\savetodatabase.cs:line
280=========================================
i am tring this code from a windows console application
Can anyone tell me where is the problem