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 396901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:35:51+00:00 2026-05-12T16:35:51+00:00

I have a text editor I made, which has been working perfectly for the

  • 0

I have a text editor I made, which has been working perfectly for the past month without any problems. But today, and all of yesterday, every time I open a txt file from explorer (double clicking it) instead of it opening in my editor, a message appears saying:

Text Editor has encountered a problem and needs to close. We are sorry
for this inconvenience. [Send error report] or [Don’t send].

When I click on “What does this error report contain”, it shows the following:

EventType : clr20r3     P1 : texteditor.exe     P2 : 1.0.0.0     P3 : 4ad32c52     
P4 : mscorlib     P5 : 2.0.0.0     P6 : 492b834a     P7 : 343f     P8 : d8     
P9 : system.io.filenotfoundexception

So that basically tells me that its looking for a file that doesn’t exist. But here’s my problem:
The file I am trying to open DOES exist because I just double clicked on it

Here is the code that opens a file that has been double clicked on from windows explorer:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace TextEditor
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (args.Length >= 1)
            {
                Form1 f = new Form1();
                f.txt.Text = System.IO.File.ReadAllText(args[0]);
                f.txt.Tag = args[0];

                Application.Run(f);
            }
            else Application.Run(new Form1());
        }
    }
}
  • 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-05-12T16:35:51+00:00Added an answer on May 12, 2026 at 4:35 pm

    The path you’re double-clicking on probably contains one or more spaces, causing the path to be sent as multiple command line arguments.

    You need to change the .txt association to send the path in quotes and/or change your app to read all command line arguments and combine them with spaces.

    Explorer is sending a command such as

    YourApp.exe C:\Documents and Settings\YourName\My Documents\YourFile.txt
    

    Since there aren’t any quotes around the string, it’s interpreted as 4 different parameters separated by spaces.

    You can change the association for .txt files to YourApp.exe "%1" (with the %1 in quotes) to force the entire string to be treated as one argument.

    Alternatively, you could replace args[0] with String.Join(" ", args) to put the arguments back together again.

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

Sidebar

Ask A Question

Stats

  • Questions 243k
  • Answers 243k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You may take a look at this article. You could… May 13, 2026 at 7:55 am
  • Editorial Team
    Editorial Team added an answer Temporarily encode <a href ...>...</a> into something else, remove all… May 13, 2026 at 7:55 am
  • Editorial Team
    Editorial Team added an answer Though not exactly what I was looking for, it seems… May 13, 2026 at 7:55 am

Related Questions

First of all, I love vim. I have been using vim for a few
I have a little problem with the creation of a user control. Though I
I have a solution that contains several c# projects and I would like to
I'm trying to implement a tinyMCE editor into an ExtJs environment. But it's not

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.