/// <summary> /// 資格情報の削除 /// </summary> /// <param name="targetName"></param> /// <param name="type"></param> /// <param name="flags"></param> private static void Delete(string targetName, CRED_TYPE type, CRED_FLAGS flags) { if (!CredDelete(targetName, type, flags)) { Log.Instance.LogWrite(LogState.ERROR, GetErrorMessage()); //throw new ApplicationException("資格情報の削除に失敗しました。"); } }
/// <summary> /// 資格情報の削除 /// </summary> /// <param name="targetName"></param> /// <param name="type"></param> /// <param name="flags"></param> private static void Delete(string targetName, CRED_TYPE type, CRED_FLAGS flags) { if (!CredDelete(targetName, type, flags)) { Console.WriteLine(GetErrorMessage()); throw new ApplicationException("資格情報の削除に失敗しました。"); } }
/// <summary> /// 資格情報の登録 /// </summary> /// <param name="unmanagedCred"></param> /// <param name="flags"></param> private static void Write(UnmanagedCredential unmanagedCred, CRED_FLAGS flags) { if (!CredWrite(ref unmanagedCred, flags)) { Log.Instance.LogWrite(LogState.ERROR, GetErrorMessage()); //throw new ApplicationException("資格情報の書き込みに失敗しました。"); } Console.WriteLine("ok"); }
/// <summary> /// 資格情報の登録 /// </summary> /// <param name="unmanagedCred"></param> /// <param name="flags"></param> private static void Write(UnmanagedCredential unmanagedCred, CRED_FLAGS flags) { if (!CredWrite(ref unmanagedCred, flags)) { Console.WriteLine(GetErrorMessage()); throw new ApplicationException("資格情報の書き込みに失敗しました。"); } Console.WriteLine("ok"); }
private static extern bool CredEnumerate(string filter, CRED_FLAGS flag, out int count, out IntPtr Credentials);
private static extern bool CredRead(string targetName, CRED_TYPE type, CRED_FLAGS flags, out IntPtr pCredential);
private static extern bool CredWrite(ref UnmanagedCredential credential, CRED_FLAGS flags);
private static extern bool CredDelete(string targetName, CRED_TYPE type, CRED_FLAGS flags);
/// <summary> /// 資格情報の削除 /// </summary> /// <param name="targetName"></param> /// <param name="type"></param> /// <param name="flags"></param> private static void Delete(string targetName, CRED_TYPE type, CRED_FLAGS flags) { if (!CredDelete(targetName, type, flags)) { Console.WriteLine(GetErrorMessage()); throw new ApplicationException("資格情報の削除に失敗しました。"); } }
private static extern bool CredEnumerate(string filter, CRED_FLAGS flag, out int count, out IntPtr pCredentials);
/// <summary> /// 資格情報の登録 /// </summary> /// <param name="unmanagedCred"></param> /// <param name="flags"></param> private static void Write(UnmanagedCredential unmanagedCred, CRED_FLAGS flags) { if (!CredWrite(ref unmanagedCred, flags)) { Console.WriteLine(GetErrorMessage()); throw new ApplicationException("資格情報の書き込みに失敗しました。"); } Console.WriteLine("ok"); }
/// <summary> /// 資格情報の登録 /// </summary> /// <param name="managedCred"></param> /// <param name="flags"></param> public static void Write(ManagedCredential managedCred, CRED_FLAGS flags) { Write(ConvertToUnmanagedCredential(managedCred), flags); }
private static extern bool CredRead(string targetName, CRED_TYPE type, CRED_FLAGS flags, out IntPtr pCredential);
private static extern bool CredWrite(ref UnmanagedCredential credential, CRED_FLAGS flags);
private static extern bool CredDelete(string targetName, CRED_TYPE type, CRED_FLAGS flags);
/// <summary> /// 資格情報の登録 /// </summary> /// <param name="managedCred"></param> /// <param name="flags"></param> public static void Write(ManagedCredential managedCred, CRED_FLAGS flags) { Write(ConvertToUnmanagedCredential(managedCred), flags); }