我有一個編譯錯誤使用C#C#不承認SafeTokenHandle
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Security.Principal;
using System.Security.Permissions;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;
[DllImport("advapi32.dll", SetLastError = true,CharSet = CharSet.Unicode)]
public static extern bool ***LogonUser***(string lpszUsername, string lpszDomain, string lpszPassword,
int dwLogonType, int dwLogonProvider, out ***SafeTokenHandle*** phToken);
在以*號(LogonUser的和SafeTokenHandle)字。由於未知類型,我的C#編譯器無法編譯。我用visual studio 2012,windows 64,framework 4.0開發。
請幫忙。
謝謝你編輯我的措辭。我的英語不好。 –