更新:2007 年 11 月
用來取得實作 IPacket 的物件。
命名空間: Microsoft.SmartDevice.DeviceAgentTransport
組件: Microsoft.SmartDevice.DeviceAgentTransport (在 Microsoft.SmartDevice.DeviceAgentTransport.dll 中)
語法
Public NotInheritable Class PacketFactory
您不需宣告靜態類別的執行個體,就能存取其成員。
public static class PacketFactory
public ref class PacketFactory abstract sealed
public final class PacketFactory
備註
請勿建立此型別的物件。這個類別 (Class) 的目的是要取得實作 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);
繼承階層架構
System.Object
Microsoft.SmartDevice.DeviceAgentTransport.PacketFactory
執行緒安全
這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。並非所有的執行個體成員都是安全執行緒。