Compartir a través de


PacketFactory.GetNewPacket (Método)

Actualización: noviembre 2007

Crea un objeto de paquete que implementa la interfaz IPacket.

Espacio de nombres:  Microsoft.SmartDevice.DeviceAgentTransport
Ensamblado:  Microsoft.SmartDevice.DeviceAgentTransport (en Microsoft.SmartDevice.DeviceAgentTransport.dll)

Sintaxis

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

Valor devuelto

Tipo: Microsoft.SmartDevice.DeviceAgentTransport.IPacket

Objeto que implementa IPacket.

Ejemplos

    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);

Permisos

Vea también

Referencia

PacketFactory (Clase)

PacketFactory (Miembros)

Microsoft.SmartDevice.DeviceAgentTransport (Espacio de nombres)