PacketFactory.GetNewPacket メソッド

更新 : 2007 年 11 月

IPacket インターフェイスを実装するパケット オブジェクトを作成します。

名前空間 :  Microsoft.SmartDevice.DeviceAgentTransport
アセンブリ :  Microsoft.SmartDevice.DeviceAgentTransport (Microsoft.SmartDevice.DeviceAgentTransport.dll 内)

構文

'宣言
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

戻り値

型 : Microsoft.SmartDevice.DeviceAgentTransport.IPacket

IPacket を実装するオブジェクト。

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

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

PacketFactory クラス

PacketFactory メンバ

Microsoft.SmartDevice.DeviceAgentTransport 名前空間