473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Compiler Error CS0201

I get this error when I try to perform;

Application.Exit;

Here is the code from my form;

using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace DatReader
{
public partial class frmMainForm : Form
{
public frmMainForm()
{
InitializeComponent();
}
private void btnLoad_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "dat files (*.dat)|*.dat|All files (*.*)|*.*";
dlg.InitialDirectory = @"D:\";
dlg.CheckFileExists = false;
if (dlg.ShowDialog() == DialogResult.OK)
{
string path = dlg.FileName;
if (File.Exists(@"D:\") != true)
rtbTextBox.Text = Streamer.LayoutInput(dlg.FileName);
}
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit;
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "dat files (*.dat)|*.dat|All files (*.*)|*.*";
dlg.InitialDirectory = @"D:\";
dlg.CheckFileExists = false;
if (dlg.ShowDialog() == DialogResult.OK)
{
string path = dlg.FileName;
if (File.Exists(@"D:\") != true)
rtbTextBox.Text = Streamer.LayoutInput(dlg.FileName);
}
}
private void higlightTextToolStripMenuItem_Click(object sender,
EventArgs e)
{

}
private void searchTextToolStripMenuItem_Click(object sender,
EventArgs e)
{

}
private void filtersToolStripMenuItem_Click(object sender, EventArgs
e)
{

}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Run(new frmAbout());
}
private void btnExit_Click(object sender, EventArgs e)
{
Application.Exit;
}
}
}
Aug 3 '07 #1
2 3145
Brian Cook wrote:
I get this error when I try to perform;

Application.Exit;

Here is the code from my form;

using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace DatReader
{
public partial class frmMainForm : Form
{
public frmMainForm()
{
InitializeComponent();
}
private void btnLoad_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "dat files (*.dat)|*.dat|All files (*.*)|*.*";
dlg.InitialDirectory = @"D:\";
dlg.CheckFileExists = false;
if (dlg.ShowDialog() == DialogResult.OK)
{
string path = dlg.FileName;
if (File.Exists(@"D:\") != true)
rtbTextBox.Text = Streamer.LayoutInput(dlg.FileName);
}
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit;
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "dat files (*.dat)|*.dat|All files (*.*)|*.*";
dlg.InitialDirectory = @"D:\";
dlg.CheckFileExists = false;
if (dlg.ShowDialog() == DialogResult.OK)
{
string path = dlg.FileName;
if (File.Exists(@"D:\") != true)
rtbTextBox.Text = Streamer.LayoutInput(dlg.FileName);
}
}
private void higlightTextToolStripMenuItem_Click(object sender,
EventArgs e)
{

}
private void searchTextToolStripMenuItem_Click(object sender,
EventArgs e)
{

}
private void filtersToolStripMenuItem_Click(object sender, EventArgs
e)
{

}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Run(new frmAbout());
}
private void btnExit_Click(object sender, EventArgs e)
{
Application.Exit;
}
}
}
Because Exit is a method, not a property. Try this:

Application.Exit();

--
-glenn-
Aug 3 '07 #2
Thanks! I figured it out after a little more searching.

"G.Doten" wrote:
Brian Cook wrote:
I get this error when I try to perform;

Application.Exit;

Here is the code from my form;

using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace DatReader
{
public partial class frmMainForm : Form
{
public frmMainForm()
{
InitializeComponent();
}
private void btnLoad_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "dat files (*.dat)|*.dat|All files (*.*)|*.*";
dlg.InitialDirectory = @"D:\";
dlg.CheckFileExists = false;
if (dlg.ShowDialog() == DialogResult.OK)
{
string path = dlg.FileName;
if (File.Exists(@"D:\") != true)
rtbTextBox.Text = Streamer.LayoutInput(dlg.FileName);
}
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit;
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "dat files (*.dat)|*.dat|All files (*.*)|*.*";
dlg.InitialDirectory = @"D:\";
dlg.CheckFileExists = false;
if (dlg.ShowDialog() == DialogResult.OK)
{
string path = dlg.FileName;
if (File.Exists(@"D:\") != true)
rtbTextBox.Text = Streamer.LayoutInput(dlg.FileName);
}
}
private void higlightTextToolStripMenuItem_Click(object sender,
EventArgs e)
{

}
private void searchTextToolStripMenuItem_Click(object sender,
EventArgs e)
{

}
private void filtersToolStripMenuItem_Click(object sender, EventArgs
e)
{

}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Run(new frmAbout());
}
private void btnExit_Click(object sender, EventArgs e)
{
Application.Exit;
}
}
}

Because Exit is a method, not a property. Try this:

Application.Exit();

--
-glenn-
Aug 3 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: paul calvert | last post by:
I hope somewhere here has encountered and solved a similar problem in the past. 1) on a new Win2000 PC: installed Visual C++ 6.0 download & install single file Service Pack 5.0 2) try to...
10
by: Bjorn | last post by:
I'm using interfaces in C++ by declaring classes with only pure virtual methods. If then someone wants to implement the interface they needs to inherit from the class. If the implementing class...
2
by: Mary | last post by:
Hello, I am having a problem with the cl compiler. I have written a C class (RegConnect.c) which uses Win32 API functions such as RegOpenKey, RegCloseKey etc. Initially when I was trying to...
0
by: rollasoc | last post by:
Hi, I seem to be getting a compiler error Internal Compiler Error (0xc0000005 at address 535DB439): likely culprit is 'BIND'. An internal error has occurred in the compiler. To work around...
1
by: Ayende Rahien | last post by:
reparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error (0xc0000005 at address 53168B12): likely culprit is 'BIND'. An internal...
3
by: Mark Rockman | last post by:
------ Build started: Project: USDAver2, Configuration: Debug .NET ------ Preparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error...
4
by: David Sworder | last post by:
Consider the following line of code (it's not important what it does): resp.DocItem=Relations.SelectDocItems_BySearchString(req.SearchPhrase); It turns out that this line is in error. The...
6
by: David Lack | last post by:
Hi, I recently installed a 60-day trial of .NET 2003 on my development system. I made tests with previous personal projects (which compiled ok with VC6) and some open source files, and keep...
27
by: Dave | last post by:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU compilers. I then decided to try to use Sun's compiler. The Sun Studio 12 compiler reports the following code, which is in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.