PacketFactory.GetNewPacket, méthode
Mise à jour : novembre 2007
Crée un objet de paquet qui implémente l'interface IPacket.
Espace de noms : Microsoft.SmartDevice.DeviceAgentTransport
Assembly : Microsoft.SmartDevice.DeviceAgentTransport (dans Microsoft.SmartDevice.DeviceAgentTransport.dll)
Syntaxe
Public Shared Function GetNewPacket As IPacket
Dim returnValue As IPacket
returnValue = PacketFactory.GetNewPacket()
public static IPacket GetNewPacket()
public:
static IPacket^ GetNewPacket()
public static function GetNewPacket() : IPacket
Valeur de retour
Type : Microsoft.SmartDevice.DeviceAgentTransport.IPacket
Un objet qui implémente IPacket.
Exemples
packet = PacketFactory.GetNewPacket()
' Write the version of .NET Compact Framework into the packet.
packet.WriteString("Hello Desktop Computer")
packet.WriteInt32(Environment.Version.Major)
packet.WriteInt32(Environment.Version.Minor)
packet.WriteInt32(Environment.Version.Build)
packet.WriteInt32(Environment.Version.Revision)
' Pass the packet to desktop application.
packetStream.Write(packet)
End Sub 'Main
packet = PacketFactory.GetNewPacket();
// Write the version of .NET Compact Framework into the packet.
packet.WriteString("Hello Desktop Computer");
packet.WriteInt32(Environment.Version.Major);
packet.WriteInt32(Environment.Version.Minor);
packet.WriteInt32(Environment.Version.Build);
packet.WriteInt32(Environment.Version.Revision);
// Pass the packet to desktop application.
packetStream.Write(packet);
Autorisations
- Confiance totale accordée à l'appelant immédiat. Ce membre ne peut pas être utilisé par du code d'un niveau de confiance partiel. Pour plus d'informations, consultez Utilisation de bibliothèques à partir de code d'un niveau de confiance partiel.