다음을 통해 공유


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 네임스페이스