이 스크립트를 실행하려고하지만 IDE에서 제목에 언급 된 오류를 표시합니다. , 특히 6 행. 내 대상 프레임 워크로 .NET 4.5로 Xamarin Studio 6.3을 사용하고 있습니다. 이 프로그램을 실행하기위한 솔루션으로 .NET Console Project를 선택했습니다. System.Security를 어셈블리 참조로 추가하려고했지만 여전히 오류가 발생했습니다. 그런 다음 문제가 지속될 경우를 대비하여 모든 .NET 4.5 관련 참조를 프로젝트에 추가했습니다. 다음은 실행하려는 스크립트입니다.C# - 'Windows'네임 스페이스에 'Security'유형 또는 네임 스페이스 이름이 없습니다 (어셈블리 참조가 누락 되었습니까?)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Security.Credentials;
namespace PasswordVaultTest
{
class Program
{
static void Main(string[] args)
{
// Create a handle to the Widnows Password vault
Windows.Security.Credentials.PasswordVault vault = new PasswordVault();
// Retrieve all the credentials from the vault
IReadOnlyList<PasswordCredential> credentials = vault.RetrieveAll();
// The list returned is an IReadOnlyList, so there is no enumerator.
// No problem, we'll just see how many credentials there are and do it the
// old fashioned way
for (int i = 0; i < credentials.Count; i++)
{
// Obtain the credential
PasswordCredential cred = credentials.ElementAt(i);
// "Fill in the password" (I wish I knew more about what this was doing)
cred.RetrievePassword();
// Print the result
Console.WriteLine(cred.Resource + ':' + cred.UserName + ':' + cred.Password);
}
Console.ReadKey();
}
}
}
내가해야 할 일의 요점을 이해하지만이 때문에 UI 내 경험 부족의 그것을 할 방법 확실 해요 : 여기에 원래의 대답에 대한 링크입니다. 자세히, 어떻게 프로젝트를 언로드합니까? – KonpakuMidori
xamarin 스튜디오의 경우 [이 링크] (https://forums.xamarin.com/discussion/8574/project-unload) 또는 [이 링크] (https://stackoverflow.com/questions/16373169/how-to- unload-project-in-xamarin) 도움이됩니다. 첫 번째 게시물에서 질문 한 사람은 두 번째 게시물에서 질문에 답한 사람과 같다고 생각합니다. 둘 다 몇 살이지만 올바른 방향으로 당신을 가리킬 수 있습니다. – Sudsy1002
프로젝트를 언로드하고 스 니펫을 추가 한 다음 프로젝트를 다시로드했습니다. slashNburn에 따르면 Windows 참조가 있어야하지만 그 중 하나는 없습니다. https://i.imgur.com/1uZrOHg.png – KonpakuMidori