Muistiinpano
Tälle sivulle pääsy edellyttää valtuutusta. Voit yrittää kirjautua sisään tai vaihtaa hakemistoja.
Tälle sivulle pääsy edellyttää valtuutusta. Voit yrittää vaihtaa hakemistoja.
The UploadFile method can be used to upload a file and store it to a remote location. If the ShowUI parameter is set to True, a dialog box is displayed that shows the progress of the upload and allows users to cancel the operation.
To upload a file
Use the
UploadFilemethod to upload a file, specifying the source file's location and the target directory location as a string or URI (Uniform Resource Identifier).This example uploads the fileOrder.txttohttp://www.cohowinery.com/uploads.aspx.My.Computer.Network.UploadFile( "C:\My Documents\Order.txt", "http://www.cohowinery.com/upload.aspx")
To upload a file and show the progress of the operation
Use the
UploadFilemethod to upload a file, specifying the source file's location and the target directory location as a string or URI. This example uploads the fileOrder.txttohttp://www.cohowinery.com/uploads.aspxwithout supplying a user name or password, shows the progress of the upload, and has a time-out interval of 500 milliseconds.My.Computer.Network.UploadFile( "C:\My Documents\Order.txt", "http://www.cohowinery.com/upload.aspx", "", "", True, 500)
To upload a file, supplying a user name and password
Use the
UploadFilemethod to upload a file, specifying the source file's location and the target directory location as a string or URI, and specifying the user name and the password. This example uploads the fileOrder.txttohttp://www.cohowinery.com/uploads.aspx, supplying the user nameanonymousand a blank password.My.Computer.Network.UploadFile( "C:\My Documents\Order.txt", "http://www.cohowinery.com/upload.aspx", "anonymous", "")
Robust Programming
The following conditions may throw an exception:
The local file path is not valid (ArgumentException).
Authentication failed (SecurityException).
The connection timed out (TimeoutException).