写成[DllImport("kernel32", CharSet = CharSet.Unicode, SetLastError = true)]
就可以
因为如果不加CharSet.Unicode,会使用默认值Charset.Auto,导致中文解析失败
写成[DllImport("kernel32", CharSet = CharSet.Unicode, SetLastError = true)]
就可以
因为如果不加CharSet.Unicode,会使用默认值Charset.Auto,导致中文解析失败