首页 > 其他 > 详细

Csharp 非安全代码

时间:2014-02-02 17:01:18      阅读:1094      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            try
            {


                unsafe
                {

                    fixed (char* a = "12345\0".ToCharArray())
                    {

                        char[] c = new char[5];
                        for (int i = 0; i < 8; i++)
                        {
                            c[i] = a[i];
                        }


                        Console.Out.WriteLine(c);
                    }
                }



            }
            catch (Exception eee)
            {

                Console.Out.WriteLine(eee.Message);
            }



            }
            
            

      
    }
}
bubuko.com,布布扣

bubuko.com,布布扣

Csharp 非安全代码

原文:http://www.cnblogs.com/webcyz/p/3537098.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!