標籤:
Are you running your application or Visual Studio that hosts the app under administrative privilege?
If that‘s the case, the Windows prevents the drag drop operation from happening. In Windows 7 or Vista, an application with a lower security privilege (your Windows Explorer with normal user privilege) cannot send data to another one (your app or Visual Studio with administrative privilege) with a higher security privilege.
Try to do one of the followings:
Run your Visual Studio without administrative privilege. Run your application outside Visual Studio without administrative privilege. Enable and long on to the Administrator account in the OS. In this case, both your Windows Explorer and your Visual Studio will have administrative privileges.
Be aware of windows vista/windows 7 security rights - if you are running Visual Studio as administrator, you will not be able to drag files from a non-administrator explorer window into your program when you run it from within visual studio. The drag related events will not even fire! I hope this helps somebody else out there not waste hours of their life...
這是因為Windows 7的安全許可權限制,導致無法激發拖拽和拖放事件,解決方案為使用Administrator使用者登入,或者將Visual Studio的啟動使用權限設定為非管理員。
Windows 7中,用Visual Studio開發WPF應用程式,實現從Windows Explorer中拖拽檔案到應用程式,始終顯示“無法拖放”符號問題解決方案