开发者

Windows Path as an argument

I am developing an application in C# to encrypr/decrypt files. I have used file association to invoke decryption application on clicking the encrypted file. So code 'Applic开发者_Go百科ation.ExecutablePath + " %1"'enables that.

%1 gives the FullName of the file. If the filename doesnt have spaces in it its works properly but if it have spaces like "C:\Folder Name\Encrypted File.enc" is received as "C:\FOLDERNAM~1\ENCRPTEDFIL~1".

How to get that File name Correctly correctly?


does this piece of code do what you need?

private string GetLongFileName(string shortName)
{
    return new FileInfo(shortName).FullName;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜