api---getfullpathname 如何获得指定的文件路径。
using System;
using System.Runtime.InteropServices;
namespace apiPath
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
[DllImport("kernel32.dll", EntryPoint="GetFullPathName")]
public static extern int GetFullPathName (
string lpFileName,
int nBufferLength,
string lpBuffer,
string lpFilePart
);
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
int nBufferLength=255;
int path;
string lpBuffer="";
string lpFilePart="";
string filename="qq.exe";
path=GetFullPathName(filename, nBufferLength,lpBuffer,lpFilePart);
Console.WriteLine("{0}",path.ToString());
//
// TODO: 在此处添加代码以启动应用程序
//
}
}
}
a 获得的结果是36 ,代表了什么 ?
b 如果要获得文件的路径该怎么运用getfullpathnam呢 ?
谢谢