在vs2008+SQL2005、语言:C#坏境下using还需要做其他的修改吗?

ASP199NET 2010-10-02 10:36:09
在vs2008+SQL2005、语言:C#坏境下using还需要做其他的修改吗?

这是一个login页面的源代码:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;


protected void btn_login_Click(object sender, EventArgs e)
{
string strcmd = "";
int i;
DataAcess mydataAcess = new DataAcess( )
if (txtUsername.Text.Trim() != "" && txtPassword.Text.Trim() != "")
{
if (DropDownList1.Text == "管理员")
{
strcmd = "select count(*) from admin where 用户名='" + txtUsername.Text + "' and 密码='" + txtPassword.Text + "'";
temp = 1;
}
if (DropDownList1.Text == "教师")
{
strcmd = "select count(*) from teacher where 教师编号='" + txtUsername.Text + "' and 密码='" + txtPassword.Text + "'";
temp = 2;
}
if (DropDownList1.Text == "学生")
{
strcmd = "select count(*) from student where 学号='" + txtUsername.Text + "' and 密码='" + txtPassword.Text + "'";
temp = 3;
}
i = mydataAcess.ExecuteScalar(strcmd);
if (i == 1)
{
Session["Username"] = txtUsername.Text.ToString();
if (temp == 1)
Response.Redirect("admin//stuadmin.aspx");
if (temp == 2)
Response.Redirect("teacher//index.aspx");
if (temp == 3)
Response.Redirect("student//index.aspx");
}
else
Response.Write("<script LANGUAGE='javascript'>alert('账号或密码错误!');history.go(-1);</script>")
}
else
{
Response.Write("<script LANGUAGE='javascript'>alert('请输入账号或密码!');history.go(-1);</script>");
txtUsername.Text = "";
txtPassword.Text = "";
}
}
...全文
67 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ASP199NET 2010-10-02
  • 打赏
  • 举报
回复
朋友能说明一下吗?
wuyq11 2010-10-02
  • 打赏
  • 举报
回复
if(!string.IsNullOrEmpty(txtUsername.Text))
{
//DropDownList1.SeletedValue
}
内容概要:本文围绕不确定环境下的多式联运路径优化问题展开研究,提出并实现了基于AFO算法、遗传算法(GA)和粒子群优化算法(PSO)的三种智能优化方法,并借助Matlab平台完成算法编程与仿真。研究构建了考虑时间、成本、转运风险等多重不确定因素的路径优化模型,系统比较了AFO、GA、PSO三种算法在收敛速度、全局寻优能力和稳定性方面的表现,同时引入Matlab自带的全局优化搜索器作为基准对照,深入分析各算法在复杂物流网络中的适用边界与性能差异。研究表明,AFO算法在解决此类组合优化问题时展现出更快的收敛效率和更强的局部规避能力。; 适合人群:具备一定Matlab编程基础与运筹优化知识,从事物流工程、交通运输规划、智能算法开发等相关领域的研究生、科研人员及工程技术人员。; 使用场景及目标:①应用于多式联运、综合货运网络中的路径决策支持系统构建;②为不确定性条件下复杂路径规划问题提供智能算法选型依据与技术实现方案;③支持科研人员复现主流优化算法并开展横向性能对比实验,推动算法改进与实际落地。; 阅读建议:建议读者结合提供的Matlab代码逐模块分析算法实现流程,重点理解目标函数设计、约束条件处理及参数敏感性分析部分,可通过调整问题规模与算法参数进行对比实验,进一步拓展至动态路径规划或大规模网络优化等延伸场景。

62,272

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧