|
度々すいません。
asukaです。
NETRESOURCE構造体をクラスにした一部です。
こんなことやってます、、、
namespace WNetAddConnectionX { public enum ResourceScope { RESOURCE_CONNECTED = 1, RESOURCE_GLOBALNET, RESOURCE_REMEMBERED, RESOURCE_RECENT, RESOURCE_CONTEXT };
public enum ResourceType { RESOURCETYPE_ANY, RESOURCETYPE_DISK, RESOURCETYPE_PRINT, RESOURCETYPE_RESERVED };
public enum ResourceUsage { RESOURCEUSAGE_CONNECTABLE = 0x00000001, RESOURCEUSAGE_CONTAINER = 0x00000002, RESOURCEUSAGE_NOLOCALDEVICE = 0x00000004, RESOURCEUSAGE_SIBLING = 0x00000008, RESOURCEUSAGE_ATTACHED = 0x00000010, RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED), }; public enum ResourceDisplayType { RESOURCEDISPLAYTYPE_GENERIC, RESOURCEDISPLAYTYPE_DOMAIN, RESOURCEDISPLAYTYPE_SERVER, RESOURCEDISPLAYTYPE_SHARE, RESOURCEDISPLAYTYPE_FILE, RESOURCEDISPLAYTYPE_GROUP, RESOURCEDISPLAYTYPE_NETWORK, RESOURCEDISPLAYTYPE_ROOT, RESOURCEDISPLAYTYPE_SHAREADMIN, RESOURCEDISPLAYTYPE_DIRECTORY, RESOURCEDISPLAYTYPE_TREE, RESOURCEDISPLAYTYPE_NDSCONTAINER };
public class IWNetCon { enum ErrorCodes { NO_ERROR = 0, // Error codes from error.h ERROR_ACCESS_DENIED = 5, ERROR_ALREADY_ASSIGNED = 85, ERROR_INVALID_PASSWORD = 86, // Error codes from winerror.h ERROR_BAD_NETPATH = 53, ERROR_BAD_DEV_TYPE = 66, ERROR_BAD_NET_NAME = 67, ERROR_BUSY = 170, ERROR_INVALID_ADDRESS = 487, ERROR_BAD_DEVICE = 1200, ERROR_DEVICE_ALREADY_REMEMBERED = 1202, ERROR_NO_NET_OR_BAD_PATH = 1203, ERROR_BAD_PROVIDER = 1204, ERROR_CANNOT_OPEN_PROFILE = 1205, ERROR_BAD_PROFILE = 1206, ERROR_EXTENDED_ERROR = 1208, ERROR_NO_NETWORK = 1222, ERROR_CANCELLED = 1223, ERROR_NOT_CONNECTED = 2250, ERROR_DEVICE_IN_USE = 2404, };
[StructLayout(LayoutKind.Sequential)] private class NETRESOURCE { public ResourceScope dwScope = 0; public ResourceType dwType = ResourceType.RESOURCETYPE_DISK; //public ResourceDisplayType dwDisplayType = 0; public ResourceDisplayType dwDisplayType = ResourceDisplayType.RESOURCEDISPLAYTYPE_SHARE; public ResourceUsage dwUsage = 0; public string lpLocalName = null; public string lpRemoteName = "\\\\B"; public string lpComment = null; public string lpProvider = null; };
・・・
|