Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 asp.net/C# Web 应用程序。我有一个图像流 .aspx 页面来呈现图像。我必须将图像复制到客户的剪贴板。所以我首先将图像加载到隐藏的图像框中,然后使用 javascript 命令将其复制到剪贴板
ctrlRange.execCommand('复制');
图像确实复制到剪贴板。它可以粘贴在 MSPaint 中。但它不能粘贴到 MS word 中。尝试粘贴时,它显示为小白框。要求是将图像粘贴到 MS word 上。
谢谢
问题似乎在于“Word paste”执行了一个额外的 Web 请求,而 Paint 或 Paste special 没有执行第二个请求。如果粘贴内容(图像)在某种身份验证(ex.forms 身份验证)之后,Word 完成的第二个请求将失败,从而导致无法正确粘贴图像。
这与 Internet 选项 -> 常规 -> 浏览历史记录 -> 设置 -> 检查存储页面的从未版本有关。当它设置为自动时,即使在 Word 中也能按预期工作,并且设置为“每次访问网页时”都会失败