C# 指定父層級目錄


1 lstrcatW(pszpath, "\\..\\..\\");
2 DWORD dwlen = GetFullPathNameW(pszpath, 0u, null, null);
3 void* pv = malloc((size_t)(uint)dwlen);
4 GetFullPathNameW(pszpath, dwlen, (char*)pv, null);
5 string sz = new string((char*)pv);
6 free(pv);

View Code