Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8965211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:45:53+00:00 2026-06-15T16:45:53+00:00

I got a strange error with this program, It download a photo from internet,

  • 0

I got a strange error with this program, It download a photo from internet, then I convert it to .jpeg and then I delete the first photo (in .png).
But i got an error: File is being used by another process. Why is happening this? I didn’t open the file, and nobody is using it.

string outFile;
outFile = Path.GetTempFileName();
try
{
    webClient.DownloadFile(foto, outFile);
    if (foto.Substring(foto.Length - 3) == "png")
    {
        System.Drawing.Image image1 = System.Drawing.Image.FromFile(outFile);
        foto = foto.Remove(foto.Length - 3) + "jpg";
        string outFile2 = Path.GetTempFileName();
        image1.Save(outFile2, System.Drawing.Imaging.ImageFormat.Jpeg);
        System.IO.File.Delete(outFile);                      
        outFile = outFile2;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:45:54+00:00Added an answer on June 15, 2026 at 4:45 pm

    FromFile is keeping the file open, you have to use something like this:

    // Load image
    FileStream filestream;
    filestream = new FileStream("Filename",FileMode.Open, FileAccess.Read);
    currentImage = System.Drawing.Image.FromStream(filestream);
    filestream.Close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a really strange error. This is the stacktrace that is coming from
I got this strange error when i want to bind something in my grid
I just randomly got this strange error via Rails 3, on heroku (postgres) PGError:
I got this strange error on SVN: Error while updating filelist (The path '/path/'
I've got a strange error with IE8 and postcode lookups. It may not be
Well, I´m developing a wpf application and I got a strange error on design
I got a strange compilation error when I followed the MSDN document to use
I've got a really simple class that is giving a strange error. The class
Today I've got a stacktrace with a very strange error. Actually, I may be
I've got a strange error working with Photoshop connection API in OSx. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.