나는 다음과 같은 C# 코드가 : 코드 ftp.upload
를 실행하려고하면C# 파일 액세스 오류
string selectedFile = "D:\..\IMGP2695.JPG";
MyImage myImage = new MyImage();
Image image = Image.FromFile(selectedFile);
string thumbnail_name = CreateThumbnail(image);
myImage.height = image.Height + "px";
myImage.width = image.Width + "px";
ftp.upload(myImage.internalName, selectedFile, directory);
The process cannot access the file `'D:\..\IMGP2695.JPG'` because it is being used by another process.
나는이 오류가 발생합니다. 오류의 의미는 무엇인지 알지만 열린 파일의 핸들을 닫으려면 어떻게해야할지 모르겠다.
왜 먼저 그것을 열고있다? –
파일은 OpenFileDialog의 결과입니다. 나는 그것을 명시 적으로 열지 않는다. –