|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
My.Computer.Network.UploadFile errorDim strUpLoadFile As String Dim siteUri As New Uri("ftp://wxyz.com/UpLdTest.zip") strUpLoadFile = "C:\Trash\UpLdTest.zip" My.Computer.Network.UploadFile(strUpLoadFile, siteUri, "johndoe", "abcdefg", 1000) PRODUCES THIS ERROR: Unable to cast object of type 'System.String' to type 'System.Net.ICredentials'. THE ERROR POINTS TO THE USERNAME PARAMATER AS THE SOURCE OF THE ERROR. I'M GUESSING THE PASSWORD PARAMETER WOULD PRODUCE AN ERROR ALSO. WHAT IS THE CORRECT CODE TO UTILIZE My.Comp....work.UploadFile? Thanks for your help. -- John Brown "John Brown" wrote: The specified signature you're using doesn't exist, you're trying to use:> My.Computer.Network.UploadFile(strUpLoadFile, siteUri, "johndoe", "abcdefg", > 1000) sourceFileName ,address ,userName ,password, connectionTimeout but the only two close signatures are either: sourceFileName ,address ,userName ,password or sourceFileName ,address ,networkCredentials ,showUI ,connectionTimeout ..NET thinks you're using the latter, and so thinks your username should be of type ICredentials. Remove the last parameter from your call: My.Computer.Network.UploadFile(strUpLoadFile, siteUri, "johndoe", "abcdefg") Thanks Leon, I think that will make it work.
-- Show quoteHide quoteJohn Brown "Leon Mayne" wrote: > "John Brown" wrote: > > My.Computer.Network.UploadFile(strUpLoadFile, siteUri, "johndoe", "abcdefg", > > 1000) > > The specified signature you're using doesn't exist, you're trying to use: > sourceFileName ,address ,userName ,password, connectionTimeout > but the only two close signatures are either: > sourceFileName ,address ,userName ,password > or > sourceFileName ,address ,networkCredentials ,showUI ,connectionTimeout > > .NET thinks you're using the latter, and so thinks your username should be > of type ICredentials. > > Remove the last parameter from your call: > My.Computer.Network.UploadFile(strUpLoadFile, siteUri, "johndoe", "abcdefg") >
Help reading control.location value back form text file
Registry Key Manipulation simple format question Getting IP Address of the ACTIVE network card DataGridView conversion problems help readin text file Needto grab the name and position of all buttons on a form -is this possible? Help reading simple text file Beginners needs some help in Writing to text file Need help to marshall Win32 DLL call to VB.net |
|||||||||||||||||||||||