Web/yx/Add.aspx.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
using System.Data.SqlClient;
namespace Maticsoft.Web.yx
{
public partial class Add : Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
(Master.FindControl("Label1") as Label).Text = "添加学院";
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
int i = FileUpload1.FileName.LastIndexOf(".");//获取扩展名的位置
string exten = FileUpload1.FileName.Substring(i);//取扩展名
string newFileName = Guid.NewGuid().ToString() + exten;//生成新的文件名
string path = "../fzjs/upfile/" + newFileName;//设置上传的目标虚拟路径
if (FileUpload1.HasFile)//如果上传文件控件不为空,既有文件
{
FileUpload1.SaveAs(Server.MapPath(path));//为当前请求将请求的URL中的虚拟路径映射到服务器上的物理路径
}
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into yx(");
strSql.Append("jsid,xyid,upath)");
strSql.Append(" values (");
strSql.Append("@jsid,@xyid,@upath)");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@jsid", SqlDbType.Int,5),
new SqlParameter("@xyid", SqlDbType.Int,5),
new SqlParameter("@upath", SqlDbType.VarChar,50)};
parameters[0].Value = int.Parse(this.DropDownList2.SelectedValue);
后面还有 17 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。