本帖最后由 q258227 于 2011-10-13 16:37:12 编辑

解决方案 »

  1.   

    我新手、C#中没有见到过Shove
    你是想要从string转换为int吧?
    直接Convert.ToInt32(//要转换的string字符串);
    这样就可以了
      

  2.   

    敢问 Shove为何?
    再问_Convert.StrToInt()为何?
      

  3.   


    string color = ColorTranslator.ToHtml(bitmap.GetPixel(X, Y));
    if (Shove._Convert.StrToInt(color.Substring(1, 1), -1) >= 0 && Shove._Convert.StrToInt(color.Substring(1, 1), -1) < 7)
    就这段代码  Shove._Convert.StrToInt() 不知道 怎么出来的 
      

  4.   

    StrToInt()函数  怎么调用的 
    本人新手 还请高手 多指教
      

  5.   

    信息太少只能猜了
    ColorTranslator.ToHtml()这个方法就是将制定的Color编译成html颜色的字符串
    (Shove._Convert.StrToInt(color.Substring(1, 1), -1)//这个根据传递的参数来看应该还有(Shove._Convert.StrToInt(color.Substring(1, 1), 0)
    (Shove._Convert.StrToInt(color.Substring(1, 1), 1)
    三种状态 
    color.Substring(1, 1)这个截取编译后的color 的第二个字符
    Shove._Convert.StrToInt()这个方法总的来说应该是判断Color是否符合要求
      

  6.   

    强制转换是不需要知道以前是什么类型的、直接To你要转的类型就好了、最开始看到StrToInt的时候就有点怀疑不是C#代码、或者Shove是你自己定义的类,但是我本身接触的不多、不敢断言、给你上C#中转换的简单例子string str = "string123";
    int i = Convert.ToInt32(str);//将字符串str转换为int并以变量“i”接收