我如何使用datagridview在C#应用程序中使用Windows的SendTo选项 [英] How I can use windows's SendTo option in my C# Application using datagridview

查看:135
本文介绍了我如何使用datagridview在C#应用程序中使用Windows的SendTo选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当文件显示在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

http://social.msdn.microsoft.com/Forums/zh-CN/csharpgeneral/thread/8d0f33a3-af4d-498f-a37b-e6fc84136c4a/

这篇关于我如何使用datagridview在C#应用程序中使用Windows的SendTo选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆