关于visual studio 2010 直接复制粘贴会出现乱码的解决方法

我们可以直接使用格式调试软件



先复制要复制的内容,然后点击clean it 

然后到 目标位置粘贴



比如:直接复制粘贴

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace test1
{
    class Program
    {
        static void Main(string[] args)
        {
            Boolean flag = true;
           string s;
            // char s;
            string mail, psw;
            while (flag)
            {
                Console.WriteLine("您??是??否??同??意?a本??服?t务?条??款????  Y/N");
             //  s = (char)Console.Read();    // 缓o冲?区? 里??存??入??啦?2 字??符?? 回?车?? 换?行D 三?y个?字??符?? 会??挨???个?读??入?? 所??以??会??三?y次??错???误??
              s = Console.ReadLine();
               //if (s == 'y' || s == 'y')
              if (s == "Y" || s == "y")
                {
                    flag = false;
                    Console.WriteLine("您??已??同??意?a本??服?t务?条??款?!??!??");
                    Console.WriteLine("请?输??入??邮???箱?地??址??进?行D注???册??");
                    mail = Console.ReadLine();
                    while (string.IsNullOrEmpty(mail))
                    {
                        Console.WriteLine("输??入??邮???箱?地??址??为a空?,??请?重?新?输??入??");
                        mail = Console.ReadLine();
                    }
                    Console.WriteLine(" 请?输??入??密??码?");
                    psw = Console.ReadLine();
                    while (string.IsNullOrEmpty(psw))
                    {
                        Console.WriteLine("输??入??密??码?为a空?,??请?重?新?输??入??");
                        psw = Console.ReadLine();
                    }
                    Console.WriteLine("注???册??成??功|");
                    Console.WriteLine("注???册??邮???箱?为a:?o" + mail + "@126.com");
                    Console.WriteLine("密??码?为a:?o" + psw);
                }
                else
                {
                    Console.WriteLine("请?输??入??正y确???指?令??");
                }
            }
        }
    }
}


使用工具后:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace test1
{
    class Program
    {
        static void Main(string[] args)
        {
            Boolean flag = true;
           string s;
            // char s;
            string mail, psw;
            while (flag)
            {
                Console.WriteLine("您是否同意本服务条款?  Y/N");
             //  s = (char)Console.Read();    // 缓冲区 里存入啦 字符 回车 换行 三个字符 会挨个读入 所以会三次错误
              s = Console.ReadLine();

               //if (s == 'y' || s == 'y')
              if (s == "Y" || s == "y")
                {
                    flag = false;
                    Console.WriteLine("您已同意本服务条款!!");
                    Console.WriteLine("请输入邮箱地址进行注册");
                    mail = Console.ReadLine();
                    while (string.IsNullOrEmpty(mail))
                    {
                        Console.WriteLine("输入邮箱地址为空,请重新输入");
                        mail = Console.ReadLine();
                    }
                    Console.WriteLine(" 请输入密码");
                    psw = Console.ReadLine();
                    while (string.IsNullOrEmpty(psw))
                    {
                        Console.WriteLine("输入密码为空,请重新输入");
                        psw = Console.ReadLine();
                    }
                    Console.WriteLine("注册成功");
                    Console.WriteLine("注册邮箱为:" + mail + "@126.com");
                    Console.WriteLine("密码为:" + psw);

                }
                else
                {
                    Console.WriteLine("请输入正确指令");
                }
            }

        }
    }
}




软件下载:

链接:http://pan.baidu.com/s/1sld9yED 密码:u9fs

 

posted @ 2016-09-15 10:31  Joe.Smith  阅读(778)  评论(0编辑  收藏  举报