闲着无聊,出个题,大家来玩玩!

listhome 2006-01-08 03:31:53
要求: 写一个控制台程序,打印出自身完整的源代码


呵呵,反正偶不会!

...全文
401 34 打赏 收藏 转发到动态 举报
写回复
用AI写文章
34 条回复
切换为时间正序
请发表友善的回复…
发表回复
randysbf 2006-01-09
  • 打赏
  • 举报
回复
可以用字符实现.
godson_h 2006-01-09
  • 打赏
  • 举报
回复
学习
hzw66 2006-01-09
  • 打赏
  • 举报
回复
随便写了个,不知道谁有更简单的方法:
using System;
namespace MyNamespace
{
class MyClass
{
public static void Main()
{
string s = @"using System;
namespace MyNamespace
{{
class MyClass
{{
public static void Main()
{{
string s = @{1}{0}{1};
Console.WriteLine(s,s,(char)34);
}}
}}
}}";
Console.WriteLine(s,s,(char)34);
}
}
}
szh3210 2006-01-09
  • 打赏
  • 举报
回复
学习
saucer 2006-01-09
  • 打赏
  • 举报
回复
http://blog.joycode.com/saucer/archive/2003/12/29/10066.aspx
xczgb 2006-01-09
  • 打赏
  • 举报
回复
继续顶
pontus 2006-01-09
  • 打赏
  • 举报
回复
写一个控制台程序,打印win2003自身完整的源代码
RoninBlade 2006-01-09
  • 打赏
  • 举报
回复
mark,学习
zhounet 2006-01-09
  • 打赏
  • 举报
回复
不会
tiaoci 2006-01-09
  • 打赏
  • 举报
回复
分交出来,看这里:

http://spaces.msn.com/members/tiaoci/Blog/cns!1pCRSdSzBYPHMkYAZPWWBjLg!121.entry
wangehuai 2006-01-09
  • 打赏
  • 举报
回复
不会,学习ing。。。
iceface57163 2006-01-09
  • 打赏
  • 举报
回复
不会....
rcyzm 2006-01-09
  • 打赏
  • 举报
回复
using System;

namespace ConsoleApplication1
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class PrintInfo
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
System.IO.FileStream fs = new System.IO.FileStream(
@"..\..\PrintInfo.cs",
System.IO.FileMode.Open,
System.IO.FileAccess.Read
);
System.IO.StreamReader sr = new System.IO.StreamReader(fs,System.Text.Encoding.Default);
System.Console.Write(sr.ReadToEnd());
System.Console.ReadLine();
}
}
}
rcyzm 2006-01-09
  • 打赏
  • 举报
回复
using System;

namespace ConsoleApplication1
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class PrintInfo
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
System.IO.FileStream fs = new System.IO.FileStream(
@"..\..\PrintInfo.cs",
System.IO.FileMode.Open,
System.IO.FileAccess.Read
);
System.IO.StreamReader sr = new System.IO.StreamReader(fs,System.Text.Encoding.Default);
System.Console.Write(sr.ReadToEnd());
System.Console.ReadLine();
}
}
}
lyangl 2006-01-09
  • 打赏
  • 举报
回复

bluelily22 2006-01-09
  • 打赏
  • 举报
回复
可以找到源文件,把文件转换为字符串,读出来
playzxw 2006-01-09
  • 打赏
  • 举报
回复
没看懂 hzw66(超越理想) 的代码
lw1a2 2006-01-09
  • 打赏
  • 举报
回复
原先在c版那见过
zxf_hay 2006-01-08
  • 打赏
  • 举报
回复
空闲的时候再高
Edisoncat 2006-01-08
  • 打赏
  • 举报
回复
关注......
加载更多回复(14)

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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