- 最後登錄
- 2024-12-15
- 在線時間
- 7258 小時
- 註冊時間
- 2010-5-4
- 閱讀權限
- 95
- 精華
- 0
- UID
- 7964333
- 帖子
- 155
- 積分
- 1282 點
- 潛水值
- 48025 米
| 本帖最後由 tryit244178 於 2021-4-9 03:51 PM 編輯
用WinAPI把長檔名轉成短檔名就行了。- [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
- public static extern int GetShortPathName(
- [MarshalAs(UnmanagedType.LPTStr)] string path,
- [MarshalAs(UnmanagedType.LPTStr)] StringBuilder shortPath,
- int shortPathLength
- );
- private void button1_Click(object sender, EventArgs e)
- {
- StringBuilder sbPath = new StringBuilder(255);
- int result = GetShortPathName("D:\\MDA RESOURCE\\catalog\\test.pdf", sbPath, sbPath.Capacity);
- System.Diagnostics.Process.Start("PDFXEdit.exe", sbPath.ToString());
- }
複製代碼 ... |
|