简体   繁体   English

可以在VSCode中拖放打开文件吗?

[英]Is drag-and-drop to open a file possible in VSCode?

I am wondering if something is wrong with my computer (or myself), because I can't seem to drag & drop a file into Visual Studio Code to open it in the editor. 我想知道我的计算机(或我自己)是否有问题,因为我似乎无法将文件拖放到Visual Studio Code中以在编辑器中将其打开。 Closing an opened folder first doesn't make a difference. 首先关闭打开的文件夹没有什么不同。 VSCode always shows me the 'stop sign', in every spot I tried (the editor, the opened tab bar, an existing opened file, ...). VSCode在我尝试过的每个位置(编辑器,打开的选项卡栏,现有的打开的文件等)中始终向我显示“停车标志”。

Why does VSCode block this ? VSCode为什么会阻止它?

(I have experienced this in earlier versions as well. Currently on v1.6 on Windows 7.) (我在较早的版本中也经历过。目前在Windows 7的v1.6上。)

Searching for a solution, I stumbled on this page , where one commenter explains: 在寻找解决方案时,我偶然发现了此页面 ,其中一位评论者解释说:

I think you are running into the security issue where lower permission processes cannot send messages to higher permission processes. 我认为您遇到了安全性问题,权限较低的进程无法将消息发送到权限较高的进程。 Explorere.exe, running at normal permission levels, cannot send the window message to winword.exe, running elevated. 以正常权限级别运行的Explorere.exe无法将窗口消息发送给提升权限的winword.exe。

I am indeed always running VSCode as Administrator, but not my Explorer windows. 我确实总是以管理员身份运行VSCode,但没有以Explorer窗口运行。

When I run VSCode in non-administrator mode (so just my regular user), drag-and-drop works fine. 当我在非管理员模式下(仅对普通用户)运行VSCode时,拖放工作正常。

I feel silly as I lost 15 minutes looking into this. 我迷失了15分钟的时间,对此感到很傻。 In case it helps: 如果有帮助:

Make sure you are not trying to open files from a zip file... 确保您不尝试从zip文件中打开文件...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM