C# 如何创建在我将智能手机插入计算机后自动运行的应用程序

C# 如何创建在我将智能手机插入计算机后自动运行的应用程序,c#,windows,registry,handler,autoplay,C#,Windows,Registry,Handler,Autoplay,我想创建一个在我将智能手机(便携式设备)插入计算机后自动运行的应用程序。我在创建一个事件处理程序来运行我的应用程序时遇到了一个大问题。有人能帮我在C#或windows注册表上做这件事吗? 64位: [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\Test Device] "Action"="Import pictures" "D

我想创建一个在我将智能手机(便携式设备)插入计算机后自动运行的应用程序。我在创建一个事件处理程序来运行我的应用程序时遇到了一个大问题。有人能帮我在C#或windows注册表上做这件事吗?

64位:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\Test Device]
"Action"="Import pictures"
"DefaultIcon"="C:\\Test Devices\\Resource\\icon.ico,0"
"Provider"="Test Devices"
"InitCmdLine"="C:\\Test Devices\\AutoPlay.exe"
"ProgID"="Shell.HWEventHandlerShellExecute"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\WPD\Source\{80E170D2-1055-4A3E-B952-82CC4F8A8689}]
"Test Device"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\WPD\VideoSource]
"Test Device"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\WPD\ImageSource]
"Test Device"=""
32位:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\Test Device]
"Action"="Import pictures"
"DefaultIcon"="C:\\Test Devices\\Resource\\icon.ico,0"
"Provider"="Test Devices"
"InitCmdLine"="C:\\Test Devices\\AutoPlay.exe"
"ProgID"="Shell.HWEventHandlerShellExecute"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\WPD\Source\{80E170D2-1055-4A3E-B952-82CC4F8A8689}]
"Test Device"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\WPD\VideoSource]
"Test Device"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\WPD\ImageSource]
"Test Device"=""

你可以在一个类似的话题上检查我的答案。看见您可以检查您的手机是否已连接,然后运行一些代码!