|
PortController.NET
SendFileYModem Method
Sends a file or batch of files using the YMODEM protocol.
Syntax
[Visual Basic]
object.SendFileYModem(String FileName)
[C#]
object.SendFileYModem(String FileName)
[C++]
object->SendFileYModem(String *FileName)
Parameters
object
An object expression that evaluates to a PortController object.
FileName/FileNames
A String/StringCollection containing absolute or relative filename(s) to be sent.
Return Value
None
Remarks
Errors
- If this method is called while a file transfer is already in progress, PortController throws a "Unable to begin file transfer because a transfer is already in progress." exception
- If the specified file cannot be found, PortController throws FileNotFoundException
- If an error occurs during the transfer, the OnFileTransferComplete event is fired
with the type of error
Example
[Visual Basic]
'Create StringCollection and add filenames to it
Dim FilesToSend As New System.Collections.Specialized.StringCollection
FilesToSend.Add("C:\\MySendFile1.bin")
FilesToSend.Add("C:\\MySendFile2.bin")
'Send the files
myPortController.SendFileYModem(FilesToSend)
[C#]
// Create StringCollection and add filenames to it
System.Collections.Specialized.StringCollection FilesToSend =
new System.Collections.Specialized.StringCollection();
FilesToSend.Add("C:\\MySendFile1.bin");
FilesToSend.Add("C:\\MySendFile2.bin");
// Send the files
myPortController.SendFileYModem(FilesToSend);
[C++]
// Create StringCollection and add filenames to it
System::Collections::Specialized::StringCollection *FilesToSend =
new System::Collections::Specialized::StringCollection;
FilesToSend->Add("C:\\MySendFile1.bin");
FilesToSend->Add("C:\\MySendFile2.bin");
// Send the files
myPortController->SendFileYModem(FilesToSend);
See Also
ReceiveFileYModem method | CancelFileTransfer method |
OnFileTransferStatusUpdate event |
OnFileTransferComplete event
|