c# 问题 请高手帮忙 Shove._Convert.StrToInt()问题 本帖最后由 q258227 于 2011-10-13 16:37:12 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我新手、C#中没有见到过Shove你是想要从string转换为int吧?直接Convert.ToInt32(//要转换的string字符串);这样就可以了 敢问 Shove为何?再问_Convert.StrToInt()为何? 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() 不知道 怎么出来的 StrToInt()函数 怎么调用的 本人新手 还请高手 多指教 信息太少只能猜了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是否符合要求 强制转换是不需要知道以前是什么类型的、直接To你要转的类型就好了、最开始看到StrToInt的时候就有点怀疑不是C#代码、或者Shove是你自己定义的类,但是我本身接触的不多、不敢断言、给你上C#中转换的简单例子string str = "string123";int i = Convert.ToInt32(str);//将字符串str转换为int并以变量“i”接收 查询的问题 C#-winform 如何获取dataGridView选中当前行内第一个单元格内的值? 共享访问程序问题 怎么用C#写一个字库提取软件呀,是16*16的点阵,求助 求教关于两个简单的ftp指令问题 大家谈谈CMS 吧,我对这个不怎么了解 如何得到字符串的字节长度和按照字节长度截取 请问Windows版的水晶报表如何取消自动分页功能 用richTextBox保存、显示、打印带图片内容的例子 我的PictureBox的问题,急急急!!! C#截取字符串咋办? 新手求教。。。感激不尽!
你是想要从string转换为int吧?
直接Convert.ToInt32(//要转换的string字符串);
这样就可以了
再问_Convert.StrToInt()为何?
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() 不知道 怎么出来的
本人新手 还请高手 多指教
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是否符合要求
int i = Convert.ToInt32(str);//将字符串str转换为int并以变量“i”接收