|
I have developed an application that will upload files to FTP Server as part of its task. Now it works quite well most of the time. But sometimes it gets web exception-called timeout exception -
System.Net.WebException: The operation has timed out. at System.Net.FtpWebRequest.GetRequestStream()
I searched in google and didn't find any useful help.
I saw an attibute (in FtpWebRequest class) called Timeout. I didn't set any value to it, cause i assumed that the default value will do. But now that it gets timeout exceptions , what should i do?
1. Can i solve it Just by setting some high value in this(timeout) attribute ? will it have any performance overhead ?
2. I am using FtpWebRequest. I am sending synchronous calls. Do I need to change it to asynchronous calls or it will be all the same? Is there any relation between time out and Sync/ASync calls ?
I am finding no solution to this. So i will be waiting for a help from this forum.
thanks
-- modified at 13:46 Wednesday 4th July, 2007
Chayan
|
|
|
|
|
hello,
i went through the articles in CP and i found some good samples to create a gmail notifier using gmail feeds..but i want to know is it possible to create an application to notify instantly whenever an email comes to my gmail account..something like in google talk or yahoo messenger
aneef
|
|
|
|
|
Why not to use the notifier from Google?
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
im asking for a developer solution..not a software recommendation.. lolz..
aneef
|
|
|
|
|
Just thought that you might have looked for that because you didn't wrote "like the notifier from Google"
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
i want a code like given below in which when i send the URL the CAPTCHA inside it should also come. here the problemis that the CAPTCHA has no specific number or id
it has only reference site and when we click it the captcha always changes. so plz give me a code that gives the appropriate captcha
private string send_Request_Data(string link, string post_data)
{
string url = string.Format(link);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
//if (proxy_enabled && proxy != null)
{
//request.Proxy = proxy;
}
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30) Firefox/0.9.2";
request.Method = "GET";
request.Accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, */*";
request.KeepAlive = true;
request.ContentType = @"application/x-www-form-urlencoded";
request.Referer = string.Format("http://www.bebo.com");
request.CookieContainer = new CookieContainer();
request.CookieContainer.Add(cookies);
if (post_data != null)
{//post the data to the desired link
string postData = string.Format(post_data);
request.Method = "POST";
byte[] postBuffer = System.Text.Encoding.GetEncoding(1252).GetBytes(postData);
request.ContentLength = postBuffer.Length;
Stream postDataStream = request.GetRequestStream();
postDataStream.Write(postBuffer, 0, postBuffer.Length);
postDataStream.Close();
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
response.Cookies = request.CookieContainer.GetCookies(request.RequestUri);
cookies.Add(response.Cookies);
Encoding enc = System.Text.Encoding.UTF8;
StreamReader responseStream = new StreamReader(response.GetResponseStream(), enc, true);
string responseHtml = responseStream.ReadToEnd();
response.Close();
responseStream.Close();
return responseHtml;
}
|
|
|
|
|
Please, PLEASE, don't put 'C#' as your header, every question here is about C#.
As has been said before, people who put captha stuff on their sites, do so exactly to stop what you're trying to do. Why do you need to do this ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Let me get this straight. You want code to read the CAPTCHA image, figure out what characters it's supposed to send and then submit the form with the correct response to the CAPTCHA?
You do realize that CAPTCHA was created to stop the automated submission of forms, right?
|
|
|
|
|
you have to wonder if he's trolling.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yeah, that's occured to me. If he posts it again, I'll just vote the thing Spam and be done with him. Another name on the blacklist...
|
|
|
|
|
No, I think it's plain old-fashioned stupidity.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Hello,
Christian Graus told you bevore to use the subject line, to inform people who whant to help you.
Cause a lot of people (including me) do not even read question with a subject line like:
C#
Help
urgent
very urgent
Maybe this[^] will help you
All the best,
Martin
|
|
|
|
|
|
That's obviously not what he's saying
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I guess Luc just forgot to set the joke message type...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Yeah, I thought it was someone else, once I knew it was him, I presumed the same.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Here it is.
I thought it was rather obvious...
|
|
|
|
|
Thing is - you look at the original post on this thread. Nothing is obvious, anymore. Like I said, when I saw it was you, it was obvious to me. I didn't notice, and not knowing who posted, it was not obvious to me.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
;);P
|
|
|
|
|
how i connect to database in VC# as when i make connection from server explorer it display there but i cudnt able to drag that onto the designer
|
|
|
|
|
|
Hello i'm beginner in c# with GDI+
can anyone tell me how i can drag drop rectangle that i draw with DrawRectangle.
please i need help
thanks
|
|
|
|
|
If you're new to C# in general, you may be biting off more than you can chew.
you want to drag and drop a rectangle, the typical way to do this is to handle mouse events to track mouse position and button status, and keep calling Invalidate() in your mouse move after updating the co-ordinates that your OnPaint will use to draw the rectangle. When you finish dragging, you need to store the location, so your onpaint continues to draw it.
Did you also expect to 'pick' a rectangle to drag by clicking on it ? To do that, you work out the co-ordinates of your mouse down and iterate through your list of rectangles, to find out which one the mouse is in.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Can i give some mouse event to this rectangle?
|
|
|
|