Re: WebClient Timeout Exception

From: Wayne (MeNotYou_at_community.nospam)
Date: 03/01/05


Date: Tue, 1 Mar 2005 07:30:44 -0500

I didn't know about the web.mail namespace back when I needed to send email,
the link below is a very simple example of how to send email with C#. I have
been using this for sometime with out issues. If all else fails you could
try it out.

http://www.codeproject.com/csharp/sendmailcsharp.asp

-- 
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
"Michael Fields" <Michael Fields@discussions.microsoft.com> wrote in message
news:2985BBB8-ED15-43EF-8567-D6DEF48FF5A3@microsoft.com...
> I have a problem with the WebClient and uploading a file to a web server.
The
> stream object returned from the WebClient.OpenWrite menthod throws a
timeout
> exception when using this method on computers w/ low bandwith ( < = 256
kbs).
> The exception occurs when I call the Stream.Close method. Here is the
code:
>
> WebClient client = new WebClient();
> Stream postStream  = client.OpenWrite(uri,"PUT");
> postStream.Write(buffer, 0, buffer.Length);
> postStream.Flush();
> postStream.Close();
>
> Buffer length is around 4 MB.  The code shown is from a Windows App that
> consumes a web service. I have tried several approaches, but haven't found
a
> working solution, such as..
>
> Writing a 2k chunk and calling flush until the entire buffer is read
> Writing a webservice method that takes an array of bytes
>
> Any suggestions would be extremely helpful
> Thanks in advance
>


Relevant Pages

  • WebClient Timeout Exception
    ... I have a problem with the WebClient and uploading a file to a web server. ... Buffer length is around 4 MB. ... Writing a 2k chunk and calling flush until the entire buffer is read ...
    (microsoft.public.dotnet.languages.csharp)
  • Passing security credentials to ASP from .net
    ... WebClient wc = new WebClient; ... NameValueCollection nvc = new NameValueCollection; ... buffer = wc.UploadValues; ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Is there a clean way to create a byte[] from an HttpWebRequest.Read?
    ... buf.CopyToor Buffer.BlockCopy) is inneficient. ... loop, using a smaller buffer) from the response and writing to a ... you could instead use WebClient: ...
    (microsoft.public.dotnet.languages.csharp)