91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 35KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-04
  • 語言: 其他
  • 標簽: Wince??Wince??usb??

資源簡介

Wince 設備USB驅動模式切換 可以在以移動硬盤方式 、微軟同步軟件方式 等4種模式間 切換,當然也要看設備是否支持

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.Runtime.InteropServices;?

namespace?USBStorage
{
????public?partial?class?FormMain2?:?Form
????{

????????private?IntPtr?hUSBFnDrv;?

????????public?FormMain2()
????????{
????????????InitializeComponent();
????????}

????????private?void?FormMain2_Load(object?sender?EventArgs?e)
????????{
????????????USBStorage.USBDevs.DEVMGR_DEVICE_INFORMATION?ddi?=?new?USBDevs.DEVMGR_DEVICE_INFORMATION();
????????????ddi.dwSize?=?Marshal.SizeOf(ddi);

????????????///利用GUID的方法.?
????????????//Guid?usbBusGuid?=?new?Guid(“E2BDC372-598F-4619-BC50-54B3F7848D35“);?
????????????//IntPtr?guidPtr?=?Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Guid)));?
????????????//Marshal.StructureToPtr(usbBusGuidguidPtrfalse);?
????????????//IntPtr?devHandle?=?USBStorage.USBDevs.FindFirstDevice(USBDevs.DeviceSearchType.DeviceSearchByGuidguidPtrref?ddi);?
????????????//Marshal.FreeHGlobal(guidPtr);?

????????????//利用Legacydevicename的方法?
????????????string?usbBusLegacyName?=?“UFN1:“;
????????????IntPtr?namePtr?=?Marshal.StringToBSTR(usbBusLegacyName);
????????????IntPtr?devHandle?=?USBStorage.USBDevs.FindFirstDevice(USBDevs.DeviceSearchType.DeviceSearchByLegacyName?namePtr?ref?ddi);

????????????if?(devHandle.ToInt32()?!=?USBDevs.INVALID_HANDLE_VALUE)
????????????{
????????????????hUSBFnDrv?=?USBDevs.CreateFile(ddi.szBusName?USBDevs.GENERIC_READ?USBDevs.FILE_SHARE_READ?IntPtr.Zero?USBDevs.OPEN_EXISTING?0?IntPtr.Zero);
????????????????if?(hUSBFnDrv.ToInt32()?!=?USBDevs.INVALID_HANDLE_VALUE)
????????????????{
????????????????????int?nByte?=?0;

????????????????????int?err?=?USBDevs.DeviceIoControlCE(hUSBFnDrv?USBDevs.IOCTL_UFN_ENUMERATE_AVAILABLE_CLIENTS_SETUP?IntPtr.Zero?0?IntPtr.Zero?0?ref?nByte?IntPtr.Zero);
????????????????????if?(err?!=?0)
????????????????????{

????????????????????????IntPtr?puci?=?Marshal.AllocHGlobal(Marshal.SizeOf(typeof(USBDevs.UFN_CLIENT_INFO)));

????????????????????????while?(USBDevs.DeviceIoControlCE(hUSBFnDrv?USBDevs.IOCTL_UFN_ENUMERATE_AVAILABLE_CLIENTS?IntPtr.Zero?0?puci?Marshal.SizeOf(typeof(USBDevs.UFN_CLIENT_INFO))?ref?nByte?IntPtr.Zero)?!=?0)
????????????????????????{
????????????????????????????USBDevs.UFN_CLIENT_INFO?uci?=?(USBDevs.UFN_CLIENT_INFO)Marshal.PtrToStructure(puci?typeof(USBDevs.UFN_CLIENT_INFO));
????????????????????????????string?itm?=?string.Format(“{0}|{1}“?uci.szName?uci.szDescription);
????????????????????????????listBoxSupportFnDrv.Items.Add(itm);
????????????????????????}
????????????????????????Marshal.FreeHGlobal(puci);
????????????????????}
????????????????????else
????????????????????{
????????????????????????err?=?USBDevs.GetLastError();
????????????????????}
????????????????}
????????????????USBDevs.CloseHandle(devHandle);
????????????}?
????????}

?????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-09-23?18:50??USBStorage\
?????目錄???????????0??2014-09-23?19:10??USBStorage\USBStorage\
?????文件????????3478??2014-09-23?19:10??USBStorage\USBStorage\FormMain2.Designer.cs
?????文件????????4733??2014-09-23?19:10??USBStorage\USBStorage\FormMain2.cs
?????文件????????6101??2014-09-23?19:10??USBStorage\USBStorage\FormMain2.resx
?????文件?????????379??2014-09-23?19:04??USBStorage\USBStorage\Program.cs
?????目錄???????????0??2014-09-23?18:49??USBStorage\USBStorage\Properties\
?????文件????????1429??2014-09-23?18:49??USBStorage\USBStorage\Properties\AssemblyInfo.cs
?????文件????????2357??2014-09-23?18:49??USBStorage\USBStorage\Properties\Resources.Designer.cs
?????文件????????5618??2014-09-23?18:49??USBStorage\USBStorage\Properties\Resources.resx
?????文件????????4602??2014-09-23?18:52??USBStorage\USBStorage\USBDevs.cs
?????文件????????4132??2014-09-23?19:11??USBStorage\USBStorage\USBStorage.csproj
?????文件?????????198??2014-09-24?01:21??USBStorage\USBStorage\USBStorage.csproj.user
?????目錄???????????0??2014-09-23?18:53??USBStorage\USBStorage\bin\
?????目錄???????????0??2014-09-23?19:11??USBStorage\USBStorage\bin\Debug\
?????文件???????10752??2014-09-29?20:56??USBStorage\USBStorage\bin\Debug\USBStorage.exe
?????文件???????22016??2014-09-29?20:56??USBStorage\USBStorage\bin\Debug\USBStorage.pdb
?????目錄???????????0??2014-09-23?18:49??USBStorage\USBStorage\obj\
?????目錄???????????0??2014-09-29?20:56??USBStorage\USBStorage\obj\Debug\
?????目錄???????????0??2014-09-29?22:59??USBStorage\USBStorage\obj\Debug\Refactor\
?????目錄???????????0??2014-09-29?22:59??USBStorage\USBStorage\obj\Debug\TempPE\
?????文件?????????180??2014-09-29?20:56??USBStorage\USBStorage\obj\Debug\USBStorage.FormMain2.resources
?????文件?????????180??2014-09-29?20:56??USBStorage\USBStorage\obj\Debug\USBStorage.Properties.Resources.resources
?????文件?????????549??2014-09-23?19:11??USBStorage\USBStorage\obj\Debug\USBStorage.csproj.FileListAbsolute.txt
?????文件?????????851??2014-09-23?19:11??USBStorage\USBStorage\obj\Debug\USBStorage.csproj.GenerateResource.Cache
?????文件???????10752??2014-09-29?20:56??USBStorage\USBStorage\obj\Debug\USBStorage.exe
?????文件???????22016??2014-09-29?20:56??USBStorage\USBStorage\obj\Debug\USBStorage.pdb
?????文件????????1086??2014-09-23?18:50??USBStorage\USBStorage.sln
?????文件???????11264??2014-09-24?01:21??USBStorage\USBStorage.suo

評論

共有 條評論