拖放到桌面图标上 [英] Drag and Drop onto Desktop Icon

查看:155
本文介绍了拖放到桌面图标上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这应该很简单。我在这里看过类似的问题,但是我的老大脑不清楚它应该如何工作。我有一个Windows窗体应用程序。我的用户希望将文件拖动到桌面上的应用程序图标上,并使用该文件执行程序。所以我想做的是:



接受图标上的删除文件;启动应用程序并将文件路径详细信息放入文本框,以便用户可以处理它。



应用程序是用C#编写的



谢谢

解决方案

尝试以下操作:

  class程序
{
static void Main(string [] args)
{
args [0]是文件
}
}


I think this should be simple. I have looked at similar questions here but it is not clear to my old brain as to how it should work. I have a Windows Forms Application. My users want to drag a file over the application icon on the desktop and execute the program with that file. So what I would like to do is:

Accept the dropped file on the icon; start the application and place the file path details into a textbox so that the user can process it.

The application is written in C#

Thanks

解决方案

Try the following:

class Program
{
   static void Main(string[] args)
   {
       args[0] is the file
   }
}

这篇关于拖放到桌面图标上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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