比如说 string id = Request.QueryString["id"].ToString();等到的是 id ="123456"我要怎么把它变成 123456L 长整形
解决方案 »
- 点击按钮1可以把值传到文本框1中,点击按钮2可以把值传到文本框2中,可是点击按钮2后,文本框1中的内容不见了,请问这是怎么回事
- 关于checkedListBox1点取在另一个窗体显示的问题
- combox 绑定数据
- 代码移植..
- 正则表达式
- 各位,有没有将bmp转换为wmf的函数或方法?
- dataGrid里的数据怎样导出到Excel中去?
- 新手!求助大神几个题目、、、、
- C#中如何调用C++6 编写的.dll 类库。
- ====关于DataGrid的使用问题,新手请教,马上给分====
- WPF 中的 ListView 控件的 GridView 视图每个列的标题部分的外观怎么修改?
- 未将对象引用设置到对象的实例 求解
转成Int64:
Int64 i=Convert.ToInt64(id);
long i=Convert.ToInt64(id);
string text = "123456";
Int64 value = Convert.ToInt64(text);
也可以这样:
string text = "123456";
Int64 value;
try
{
if (!Int64.TryParse(text, out value))
{
// TODO - Notify that error occurs Console.WriteLine("Error occurs while converting text to int64 value.");
} Console.WriteLine("{0}", value);
}
catch(ArgumentException ex)
{
// TODO - Notify that error occurs Console.WriteLine(ex.Message);
}
你晓不晓得那个“L”的意思呀?你分别定义一个int32值和一个int64值,然后debug一下:你看到了吗?所谓的“L”,不就是第二个截图里面的情形吗?
ItemcatsGetResponse ite = ItemAPI.itempropsGet(0L);
这样传正常 Int64 _id = Convert.ToInt64(id);
ItemcatsGetResponse t = TopApiHelper.ItemAPI.itempropsGet(_id);
这样什么都得不到啊