代码之家  ›  专栏  ›  技术社区  ›  Anonymous Type

反射名称空间是用C#编写quine的构造块吗?

  •  0
  • Anonymous Type  · 技术社区  · 15 年前

    我需要使用反射来为C#编写quine程序吗? quine 从磁盘打开源文件是“作弊” 所以我想使用.net reflector和/或使用System.IO打开源文件是一种攻击。

    除了使用反射之外,还有其他方法我应该考虑。

    1 回复  |  直到 15 年前
        1
  •  2
  •   Community Mohan Dere    8 年前

    事实上,你不需要思考或其他任何东西来做一个奎因,只是一个小小的字符串修剪和一些时间。

    using System;      
    class Q      
    {   
        static void Main()    
        {
            string s = "using System;class Q{2}static void Main(){2}string s ={1}{0}{1};
            Console.Write(string.Format(s, s, (char)34, (char)123, (char)125));{3}{3}";             
            Console.Write(string.Format(s, s, (char)34, (char)123, (char)125));          
        }   
    } 
    

    Here 是另一个主题相似的堆栈溢出问题。 上面的奎因来自 here .