OK ...이 코드의 일부 가장 유용합니다. 리소스를 해제해야합니다. 그렇지 않으면 파일을 webclient 또는 기타에서 사용할 수 없습니다. 기타 :webclient가 파일을 사용할 수 없습니다. (다른 프로세스에서 사용 중입니다.)
WebClient webClient = new WebClient();
string remote = "sample.jpg";
string px = Request.PhysicalApplicationPath.ToString();
if (File.Exists(px+"1.jpg") != true)
{
string local = px + "1.jpg";
webClient.DownloadFile(remote, local);
}
else
{
string local = px + "2.jpg";
webClient.DownloadFile(remote, local);
}
try
{
byte A, R, G, B;
Color pixelColor;
Color pixelColor1;
string rt = px + "1.jpg";
string rt1 = px + "2.jpg";
System.Drawing.Image a = System.Drawing.Image.FromFile(rt);
Bitmap bitmapImage = new Bitmap(a);
System.Drawing.Image a1 = System.Drawing.Image.FromFile(rt1);
Bitmap bitmapImage1 = new Bitmap(a1);
List<string> list = new List<string>();
for (int y = 0; y < bitmapImage.Height; y++)
{
for (int x = 0; x < bitmapImage.Width; x++)
{
pixelColor = bitmapImage.GetPixel(x, y);
pixelColor1 = bitmapImage1.GetPixel(x, y);
이 오류가 발생합니다.
Line 168: webClient.DownloadFile(remote, local);" [IOException: The process cannot access the file
정말 여기에 질문을 따르지 마십시오. 이 코드에서 사용중인 파일이 있지만 재정의로 수정할 수 있습니까? 우리에게 무엇이 필요합니까? – paqogomez
이것은 "Line 168 : webClient.DownloadFile (remote, local);"오류입니다. [IOException : 프로세스가 파일 – user3130269
에 액세스 할 수 없습니다. 어떤 행이 168 행입니까? – paqogomez