나는이 오류가 무엇입니까 : 경로 'C에 대한 접근 : \ 사용자 스톰 키어 난을 \ 유형'System.UnauthorizedAccessException '형식의 처리되지 않은 예외가직렬화 문제 : System.UnauthorizedAccessException
는 추가 정보가 mscorlib.dll에서 발생 \ Desktop (NEW) Archetype Development Kit \ 실험실 \ 실험실 \ bin \ x86 \ Debug \ lol.dataf '가 거부되었습니다. 이 프로젝트는 내 바탕 화면에있는
public static void BinarySerialize<T>(this T t, string path)
{
DirectoryInfo directoryInfo = new DirectoryInfo(path);
directoryInfo.EnsureDirectory();
using (FileStream stream = new FileStream(directoryInfo.FullName, FileMode.OpenOrCreate))
{
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream, t);
}
}
는,이과 거의 동일한 코드가 내 문서 폴더에있는 VS/프로젝트에 서로가이 코드를 통해 개체를 직렬화하려고에서
잘 실행됩니다. 유일한 차이점은 일반적인 것이 아닙니다. 어떤 아이디어?
여기에 데이터베이스가 관련된 곳이 없습니다. – Amy