我如何使用datagridview在C#应用程序中使用Windows的SendTo选项 [英] How I can use windows's SendTo option in my C# Application using datagridview
问题描述
当文件显示在datagridview中时,单击该特定文件夹名称,我就会列出目录中的文件.现在使用上下文菜单,我想在该上下文菜单中添加此sendto选项,并将该文件发送到任何可移动媒体.
i am listing files from directories on click on that specific folder name, when files show in datagridview. Now using context menu i want to add this sendto option in that context menu and want to send that file to any removable media.
推荐答案
在Windows发送至"菜单中看到的程序的快捷方式存储在%APPDATA%\Microsoft\Windows\SendTo
文件夹中.
The shortcuts to programs that you see in windows 'send-to' menu are stored in %APPDATA%\Microsoft\Windows\SendTo
folder.
读取此文件夹的内容,并在Grid的上下文菜单中显示选项.
Read the contents of this folder and show the options in your Grid's context menu.
快捷方式是.LNK
文件.从LNK文件解析EXE的名称,然后使用System.Diagnostics.Process.Run
The shortcuts are .LNK
files. Resolve the name of the EXE from the LNK file and call the EXE using System.Diagnostics.Process.Run
这是从LNK文件解析EXE位置的方法
Here is how you can resolve the EXE location from the LNK files
这篇关于我如何使用datagridview在C#应用程序中使用Windows的SendTo选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!