在Powershell中以编程方式转储路径时,重复字符被跳过
Repeat character is getting skipped while dumping path programmatically in Powershell
我正在使用SendMessage API将脚本文件路径中的字符逐个转储到Powershell控制台上。
在第一次执行程序时,powershell 会从产生问题的路径中跳过重复的字符。
例如 "C:\myFolder\abbc\test.ps1">
当我将字符转储到 powershell 窗口时,从上面的路径,它会从"abbc"跳过 1 b,因此在控制台上转储的最终路径是"C:\myFolder\abc\test.ps1"。
这只发生在应用程序的第一次执行中,在随后的执行中它工作正常,也接受重复字符。
SendMessage
不是正确的方法。您应该使用SendInput
.另请参阅如何使用 sendinput 函数C++了解更多信息。
相关文章:
- C++字符*缓冲区的大小
- HEX值到wchar_t字符(UTF-8)的转换
- 为什么 Serial.println(<char[]>);返回随机字符?
- 我的字符计数代码计算错误.为什么
- 字符串-C++后显示的随机字符
- 将Integer转换为4字节的unsined字符矢量(按大端字节顺序)
- 如何在C++中从字符串中分割字符
- 在基于英语的系统上将 UTF-8 路径转换为宽字符会引发异常
- 使用连续字符及其路径查找矩阵中最长路径的长度
- 在Powershell中以编程方式转储路径时,重复字符被跳过
- 在 Windows 上,stat 和 GetFileAttributes 对于包含奇怪字符的路径失败
- 无法转换 .CATPart 文件.错误:输入文件路径似乎包含不支持的字符
- 如何确定具有文件路径的字符串中是否有任何非 ASCII 字符
- 在 cpp 中验证路径:无法使用 ASCII 代码删除特殊字符
- C++ 路径文件存在限制为 260 个字符
- 获取路径删除和串联字符
- 如何将常量字符**路径分配为字符串
- 使用sf_open时,libsndfile将路径截断为512个字符
- BoostPython:在路径中加载带有unicode字符的Python模块
- 文件夹路径序列化的最大字符长度