I get an error (attachment) when I try to run the code with the following ftp path. ftp://penappit01/usr2/unisex/modulli...76829.fejl.xml
It's driving me nuts - maybe I've just looked at it too long, but if someone out there can see what's wrong I'd appreciate it.
I checked the WebRequest.Create() method with that URI on my on machine and it worked fine... weird! That 'The handle is invalid' message seems kind of strange. Have you inspected the InnerException property to see what that's all about?
R.I.P. 3.5" Floppy Drives
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." - Albert Einstein
According to FtpWebRequest.KeepAlive property in msdn...
Gets or sets a Boolean value that specifies whether the control connection to the FTP server is closed after the request completes.
What I believe is going on is that the ftp server keeps the connection alive after the ftp variable has gone out of scope. The error is because the 'ftp' instance isn't around anymore and the ftp service tries to ping the instance (as part of its keep alive functionality).
It is indeed weird. The only thing I get in the exception is that "the handle is invald" whatever handle that may be.
I get the exception in the Create() call, so disabling KeepAlive won't change anything as the exception is thrown in the previous line.
The really weird thing is, that this has worked previously. I'm starting to wonder if it really is some (sub) DLL that it can't load, and thus can't get a handle to...
Hm...apparently it helped to re-add System.Net, kill my resharper cache and then recompile everything.
Sorry for disturbing the peace on the forum for this. Now all I have to deal with is that it whines about my filename not being correct. For some reason it now gives me a 553 File name not allowed :-/
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.