已掉线,重新登录

首页 > 绿虎论坛 > 历史版块 > 编程

标题: 一些程序,虎哥帮忙

作者: @Ta

时间: 2011-03-01

点击: 1883

if(ispostback)
{string Sfirst=request.form["txtfirst"];
string Ssecond=request.form["txtsecond"]
string Soperation=request.form["optoperaton"];
int nf=0;
int ns=0;
这里冒出的nf.ns是何居心啊!int.tryparse(Sfirst,out nf);
int.tryparse(Sseconed,out ns);这两句是什么意思啊
int nr=0;把0给了nr吗?
if(soperation=="add") 
nr=nf+ns;
else
nr=nf-ns;}
虎哥!+_+

[隐藏样式|查看源码]


『回复列表(3|隐藏机器人聊天)』

1. string a="1086346";
int b=0;
int.tryparse(a,out b);
/*把a转换成数字并赋值给b*/
(/@Ta/2011-03-02 13:02//)

2. 在PHP里面,上面的语句可以用:
if($_POST['ispostback'])
{
$nf=floor($_POST['txtfirst']);
$ns=floor($_POST['txtsecond']);
if($_POST['optoperotion'])=='add')
 $nr=nf+$ns;
else
 $nr=$nf-$ns;
}
(/@Ta/2011-03-02 13:10//)

3. 深奥
(/@Ta/2011-03-03 13:18//)

回复需要登录

7月25日 11:19 星期五

本站由hu60wap6驱动

备案号: 京ICP备18041936号-1