Método PacketFactory.GetNewPacket
Cria um objeto de pacote que implementa o IPacket interface.
Namespace: Microsoft.SmartDevice.DeviceAgentTransport
Assembly: Microsoft.SmartDevice.DeviceAgentTransport (em Microsoft.SmartDevice.DeviceAgentTransport.dll)
Sintaxe
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 de retorno
Tipo: Microsoft.SmartDevice.DeviceAgentTransport.IPacket
Um objeto que implementa IPacket.
Exemplos
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);
Permissões
- Confiança total para o chamador imediato. O membro não pode ser usado por código parcialmente confiável. Para obter mais informações, consulte Usando bibliotecas de códigos parcialmente Confiável.