惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
罗磊的独立博客
F
Fortinet All Blogs
T
Threatpost
Y
Y Combinator Blog
博客园_首页
美团技术团队
Security Latest
Security Latest
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
V
V2EX - 技术
The Cloudflare Blog
L
LINUX DO - 热门话题
博客园 - 司徒正美
Jina AI
Jina AI
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
Cybersecurity and Infrastructure Security Agency CISA
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
The Hacker News
The Hacker News
P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
Latest news
Latest news
NISL@THU
NISL@THU
Google DeepMind News
Google DeepMind News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cisco Blogs
雷峰网
雷峰网
Application and Cybersecurity Blog
Application and Cybersecurity Blog
B
Blog RSS Feed
W
WeLiveSecurity
D
DataBreaches.Net
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY
Spread Privacy
Spread Privacy
Know Your Adversary
Know Your Adversary
TaoSecurity Blog
TaoSecurity Blog
S
Securelist
Help Net Security
Help Net Security

博客园 - 李战

解剖JavaScript中的null和undefined 《悟透JavaScript》感谢语 JavaScript判断浏览器类型及版本 浏览器兼容笔记 阿里与Google间的PK 硬盘那点事儿 做快乐的程序员 - 在淘宝网的一次讲座 《悟透JavaScript》之 甘露模型(新) 主键的故事 《悟透JavaScript》小故事摘录之二 《悟透JavaScript》小故事摘录之一 MSDN网站正式从第一版切换到第二版 为JavaScript程序添加客户端不可见的注释 RE: 悟透JavaScript 悟透JavaScript 对象生死劫 - 构造函数和析构函数的异常 软件思想回顾与展望 登山的程序员 - 反思极限编程之“原代码就是设计” 一个SELECT语句引发的迭代(SELECT @local_variable = expression 的妙用)
输出自己源代码的C#程序
李战 · 2008-03-24 · via 博客园 - 李战

Posted on 2008-03-24 20:34  李战  阅读(15831)  评论(10)    收藏  举报

    今天是情人节,无聊中就把以前写的这个程序发一下:

class writeme{static void Main(){string s="class writeme{{static void Main(){{string s={0}{1}{0};System.Console.Write(s,(char)34,s);}}}}"; System.Console.Write(s,(char)34,s);}}

    有趣的是,这个C#程序编译运行后,又会在控制台中输出和自身一模一样的源代码。注意,输出自己的源代码确实是靠自身代码的运行而产生的。

    从逻辑学上说,自我包含往往会产生逻辑悖论,但这个程序却不会。

    你知道为什么吗?

李战(leadzen).深圳 2008-2-14