|登录 |注册

查看: 1632|回复: 1
打印 上一主题 下一主题

C# session question

[复制链接]
youngfei
2010-4-10 08:17 AM
if (Session["Wrong"] != null)
          session["Wrong"] = Convert.ToInt32(Session["Wrong"].ToString()) + 1;
                  else
                 Session["Wrong"] = 1;
     if (Session["correct"] != null)
          session["correct"] = Convert.ToInt32(Session["Wrong"].ToString()) + 1;
                  else
                 Session["correct"] = 1;
{
int Correct = Convert.ToInt32(Session["Correct"].ToString());
                    int total = Convert.ToInt32(Session["Wrong"].ToString()) + Convert.ToInt32(Session["Correct"].ToString());
                    double dbMark = 100 * correct / total;
                    Response.Write("    " + total.ToString() + "      " + dbMark.ToString());}
我要这样set 才对呢~
我做了很久可以还是拿不到答案T。T
goodday
2010-4-11 04:32 PM
double dbMark = 100 * correct / total;
问题是在这边   int 要换 double
您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2026-1-1 01:52 PM , Processed in 1.414568 second(s), 24 queries .

Powered by Discuz! X2.5 © 2001-2012 Comsenz Inc.

本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved

Dedicated Server powered by iCore Technology Sdn. Bhd.

合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部