111,090
社区成员




System.Diagnostics.Process.Start("excel.exe",string fileName);
fileName="C:\\Documents and Settings\\QianFang\\桌面\\test\\标准框接件单\\HYB11911-HYB11911.xls";
fileName="D:\\test\\标准框接件单\\HYB11911-HYB11911.xls";
[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 Form1_Load(object sender, EventArgs e)
{
string fileName = @"D:\安装程序\Image_Pan_and_Zoom\bin\Debug\ImageZoom.exe";
if (System.IO.File.Exists(fileName))
{
StringBuilder sb = new StringBuilder(2048);
int ret = GetShortPathName(fileName, sb, sb.Capacity);
fileName = sb.ToString();
}
}