SourceAddress Property

Returns the source address of the file transfer.

Syntax

NSFile.SourceAddress

Remarks

This property can be used to determine the IP address of the sender. One of the uses of this property is to ensure that the source you received a transfer from is the correct source. This property can be useful both as a security measure to validate multicast sources, and to sort out transfers from more than one source. Note that the EndpointAddress property in a multicast transfer indicates the multicast address that the receiver is listening to, not the sender's address.

This property is available after at least one file transfer.

The following example shows how to add minimal security to a multicast file transfer. The file transfer control is named nsfile. When the Transfer Started event is triggered, a check is made to see whether the source address is the one expected (239.4.7.54). If it is not, then a subroutine (StopTransfer) is called that cancels the transfer and notifies the user.

Sub NSFile_FtsOnTransferStarted
 If Not (nsfile.SourceAddress = "239.4.7.54") Then StopTransfer
End Sub
...
Sub StopTransfer
 nsfile.FtsCancelFileTransferReceive()
 MsgBox "The transfer has been cancelled. Wrong source address."
End Sub
© 1996-1998 Microsoft Corporation. All rights reserved.