请原谅是我是C#的菜鸟~~~在网上查了用法用如下句子我还是不会用
Console.WriteLine(Convert.ToString(0xa,10))
这个“ToString”说没有什么程序集?怎么整?
大虾们帮帮忙啊~~~
还有一个问题,如果我是要从txt中读取好多16进制数出来,然后转换成10进制数输出txt,又该怎么写呢?
跪求帮忙~~~

解决方案 »

  1.   

    ~~~~(>_<)~~~~ ,看给我激动的,错啦,是16进制转10进制
      

  2.   

    出现没有程序集的错误应该是你没有添加System引用吧
      

  3.   

    恩,应该是这样,不过我不知道是哪一个system引用~~
      

  4.   

    public static int ToInt32 (
    string value,
    int fromBase
    )
    将指定基数的数字的 String 表示形式转换为等效的 32 位有符号整数。 
    uint i = Convert.ToUInt32("", 16);
    MessageBox.Show(i.ToString());
      

  5.   

    int i = Convert.ToInt32("0xa", 16);
      

  6.   

    int i = 0xa;//数字形式直接赋值
    int i = Convert.ToInt32("0xa", 16);//字符串形式才需要转换
      

  7.   

                using (StreamReader sr = new StreamReader(""))//源文件路径
                {
                    using (StreamWriter sw = new StreamWriter(""))//新文件路径
                    {
                        string strLine = sr.ReadLine();
                        while (!string.IsNullOrEmpty(strLine))
                        {
                            //转化成十进制
                            //strLine =10To!6(strLine);
                            sw.WriteLine(strLine);
                            strLine = sr.ReadLine();
                        }
                        sw.Close();
                    }         
                }
                
      

  8.   


    using (StreamReader sr = new StreamReader(""))//源文件路径
    {
        using (StreamWriter sw = new StreamWriter(""))//新文件路径
        {
            string strLine = sr.ReadLine();
            while (!string.IsNullOrEmpty(strLine))
            {
                //转化成十进制
                //strLine =  strLine;
                sw.WriteLine(strLine);
                strLine = sr.ReadLine();
            }
            sw.Close();
        }         
    }
         
      

  9.   

    大虾,你把代码写全可以么?
    是直接main函数里面就这么写么?这里面需要的system引用都有啥啊?