using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;namespace WindowsApplication13
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null; public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent(); //
// TODO: Add any constructor code after InitializeComponent call
//
} /// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null) 
{
components.Dispose();
}
}
base.Dispose( disposing );
} #region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
// 
// Form1
// 
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load); }
#endregion /// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string [ ]args) 
{
Application.Run(new Form1());
console.writeline("ok");
} private void Form1_Load(object sender, System.EventArgs e)
{

}
}
}这个程序我就只是在 static void Main(string [ ]args) 中加了一句
console.writeline("ok");可是 console 有错误
它提示的错误是:
C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\WindowsApplication13\Form1.cs(73): The type or namespace name 'console' could not be found (are you missing a using directive or an assembly reference?)谢谢!

解决方案 »

  1.   

    你的Console写的没有问题?
      

  2.   

    Console.WriteLine("Hello World!") ;另外,在WindowsApplication13项目上单击右键->属性->常规->输出类型修改为控制台应用程序
    才能在控制台看到输出"Hello World!"
      

  3.   

    ZhouQiang() ( ) 信誉:100  2005-03-18 15:29:00  得分: 0  
     
     
       Console.WriteLine("Hello World!") ;另外,在WindowsApplication13项目上单击右键->属性->常规->输出类型修改为控制台应用程序
    才能在控制台看到输出"Hello World!"