@@ 简单--在Windows 应用程序类似如何实现控制台中的Console.WriteLine,

020job 2008-06-05 09:52:12
简单--在Windows 应用程序类似如何实现控制台中的Console.WriteLine,

类似输出结果
11
22
32
12
343
23
22
..
...
10万条以上。
...全文
212 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
竹子的信仰 2011-09-07
  • 打赏
  • 举报
回复
哈哈,这个很简单的,只要在项目中把你的窗口应用程序输出类型改为控制台应用程序就行了。
这样,在你运行窗口应用程序时,就会弹出一个Dos窗口,专门显示你Console.WriteLine()方法的输出结果,方便查看。
onewxw_1 2008-06-05
  • 打赏
  • 举报
回复
加个label控件。

int i=0;
while(i<10000)
{
if(i%2==0)label1.Text ="";

label1.Text=label1.Text+i.ToString();
i++;
System.Threading.Thread.Sleep(1000);

}
lsj_zrp 2008-06-05
  • 打赏
  • 举报
回复

while(i <10000)
{
Graphics g = this.CreateGraphics();
SolidBrush brush = new SolidBrush(Color.Gainsboro );
g.FillRectangle(brush, 10, 10, 50, 50);
g.DrawString(i.ToString()+" 结果", new Font(FontFamily.Families[0], 10), Brushes.Black, 10, 10);

i++;
System.Threading.Thread.Sleep(1000);

}
020job 2008-06-05
  • 打赏
  • 举报
回复
好像还很容易挂掉程序
020job 2008-06-05
  • 打赏
  • 举报
回复
ericzhangbo1982111
用了你的
while(i<10000)
{
Graphics g = this.CreateGraphics();

g.DrawString(i.ToString()+" 结果", new Font(FontFamily.Families[0], 10), Brushes.Black, 10, 10);

i++;
System.Threading.Thread.Sleep(1000);

}


每次都是重叠的影子,怎么给上次的清楚掉啊

020job 2008-06-05
  • 打赏
  • 举报
回复
ericzhangbo1982111 :

每次都是重叠的影子,怎么给上次的清楚掉啊
ericzhangbo1982111 2008-06-05
  • 打赏
  • 举报
回复
Graphics g = this.CreateGraphics();
g.DrawString("", new Font(FontFamily.Families[0], 10), Brushes.Black, 10, 10);
020job 2008-06-05
  • 打赏
  • 举报
回复
就是输出到窗体上,叫我看到
gomoku 2008-06-05
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 020job 的回复:]
就是给自己看看其中的进度执行情况。
[/Quote]

In such case, in the Project Properties menu, change the 'output type' from Windows Application to Console Application.
You will be running a Winform with a console attached.
drq6772 2008-06-05
  • 打赏
  • 举报
回复
LZ的意思是要跳出控制台输出么?
ericzhangbo1982111 2008-06-05
  • 打赏
  • 举报
回复
那总要说输出在那里把
窗体上?
还是别的地方?
窗体上就是
DrawText
020job 2008-06-05
  • 打赏
  • 举报
回复
就是给自己看看其中的进度执行情况。
lsj_zrp 2008-06-05
  • 打赏
  • 举报
回复
在Windows 应用程序中你要输出到哪里?

111,125

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧