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

  • SEARCH
  • Home
  • 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 7726769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:17:57+00:00 2026-06-01T05:17:57+00:00

When executing the following code: OpenFileDialog dialog = new OpenFileDialog(); DialogResult result = dialog.ShowDialog();

  • 0

When executing the following code:

OpenFileDialog dialog = new OpenFileDialog();
DialogResult result = dialog.ShowDialog();
string filename = "";
if (result == DialogResult.OK)
{
     filename = dialog.FileName;
     //create a new Thread and read the file.
}
else
{
     return;
}

I’m facing a strange memory behaviour: the memory usage goes up very fast till 710 MB, then it starts floatating byte-by-byte up and down close to 710MB, and finally I get a OutOfMemoryException.

But, if I run the code without the OpenFileDialog, by simply hard-coding the filepath:

string filename = "_complete_file_path_here";
//create a new Thread and read the file.

it will work without any problem: the memory goes up till 840 MB without esitations, and file get read correctly.

Any idea or feedback?

  • 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-01T05:17:58+00:00Added an answer on June 1, 2026 at 5:17 am

    This sort of issue can be caused by a bad shell extension. Use Process Explorer or the debugger output to check what DLLs are loaded into your process when you use the File Open dialog. If you find anything suspicious, try uninstalling the associated software. (Printers are for some reason often a culprit here).

    The reason is that the file open dialog loads Windows Explorer shell extensions, and unfortunately many of the third-party ones are buggy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When executing the following block of code: foreach($eventfiles as $eventfile) { if($eventfile['filename']) { $file
If I try executing the following code f = file('test','rb') fout = file('test.out','wb') for
I am executing the following code: def takeN(s : String, n : Int): String
I'm trying to play an mp3 audio file on iPhone executing the following code:
From what I've read about Tasks, the following code should cancel the currently executing
I am getting Incorrect syntax near the keyword 'select' after executing the following code.
Executing the below code gives me the following exception on the last line: InvalidOperationException:
When executing the following code I receive a run time error when the code
While executing the following code i gets this error Late bound operations cannot be
I get an off by one error while executing the following code #include <iostream>

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.