About PortController
Introduction
Purchasing PortController
Redistributing PortController
License Agreement
Support
Getting Started
How to Use PortController
PortController Sample Projects
Handling PortController Errors
Reference
Properties
AvailableSystemPorts
BaudRate Property
Break Property
BytesUsedRQ Property
BytesUsedTQ Property
Cd Property
Cts Property
DataBits Property
Dsr Property
Dtr Property
DtrDsr Property
EnableReadOnEventChar Property
EventChar Property
ForceBeginInvokeEventFiring Property
IsOpen Property
IsFileTransferInProgress Property
Parity Property
PortHandle Property
PortName Property
ReceiveBufferSize Property
Ring Property
Rts Property
RtsCts Property
StopBits Property
SystemPorts Property
TraceOutput Property
TransmitBufferSize
XoffByte Property
XonByte Property
XonXoff Property
Methods
CancelFileTransfer Method
ClearRQ Method
ClearTQ Method
Close Method
GetErrorStatus Method
Open Method
Read Method
ReadBinary Method
ReceiveFileXModem Method
ReceiveFileXModemCRC Method
ReceiveFileYModem Method
ReceiveFileZModem Method
SendFileXModem Method
SendFileXModem1k Method
SendFileYModem Method
SendFileZModem Method
SimulateReceivedXoff Method
SimulateReceivedXon Method
Write Method
WriteBinary Method
Events
OnBreakSignal Event
OnCdToggle Event
OnCtsToggle Event
OnDataReceived Event
OnDsrToggle Event
OnError Event
OnEventCharReceived Event
OnFileTransferComplete Event
OnFileTransferStatusUpdate Event
OnRing Event
OnTQEmpty Event

ReceiveFileYModem Method

Receives one or more files using the YMODEM protocol.

Syntax

[Visual Basic]
object.ReceiveFileYModem(PathName [, Binary = True])

[C#]
object.ReceiveFileYModem(PathName [, Binary = true])

[C++]
object->ReceiveFileYModem(PathName [, Binary = true])

Parameters

object

An object expression that evaluates to a PortController object.

PathName

A string containing an absolute or relative pathname indicating where the received files are to be saved.

[optional] Binary

A Boolean value indicating whether the files to be received are binary files. Defaults to true.

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
  • Since YMODEM filenames are specified by the sender, all file path/permission errors are communicated through the OnFileTransferComplete event
  • If an error occurs during the transfer, the OnFileTransferComplete event is fired with the type of error

Example

[Visual Basic]
myPortController.ReceiveFileYModem("C:\", True)


[C#]
myPortController.ReceiveFileYModem("C:\\", true);


[C++]
myPortController->ReceiveFileYModem("C:\\", true);

See Also

SendFileYModem method | CancelFileTransfer method | OnFileTransferStatusUpdate event | OnFileTransferComplete event