Admin/ChengLiang.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;
public partial class ChengLiang : System.Web.UI.Page
{
public string fname;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// this.TextBox2.Text=Session["username"].ToString();
}
}
private void hsgupload()
{
if (UploadFile.Value != null)
{
string nam = UploadFile.PostedFile.FileName;
//取得文件名(抱括路径)里最后一个"."的索引
int i = nam.LastIndexOf(".");
//取得文件扩展名
string newext = nam.Substring(i);
//这里我自动根据日期和文件大小不同为文件命名,确保文件名不重复
DateTime now = DateTime.Now;
string newname = now.DayOfYear.ToString() + UploadFile.PostedFile.ContentLength.ToString();
//保存文件到你所要的目录,这里是IIS根目录下的uploadfiles目录
//注意: 我这里用Server.MapPath()取当前文件的绝对目录.在asp.net里"\"必须用"\\"代替
UploadFile.PostedFile.SaveAs(Server.MapPath("../UpLoad/" + newname + newext));
//得到这个文件的相关属性:文件名,文件类型,文件大小
//string fname;
fname = newname + newext;
//Response.Write("<script>javascript:alert('"+fname+"');</script>");
//fenc.Text=UploadFile.PostedFile.ContentType ;
//fsize.Text=UploadFile.PostedFile.ContentLength.ToString();
//Image1.ImageUrl = "http://localhost/web/news/uploadfiles/"+newname+newext;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (UploadFile.Value != null && UploadFile.Value != "")
{
hsgupload();
}
string sql;
sql = "insert into 车辆信息(车辆型号,租金信息,地域信息,联系人,联系电话,具体描述,图片) values('" + this.TextBox1.Text.Trim() + "','" + this.TextBox2.Text + "','" + this.TextBox3.Text + "','" + this.TextBox4.Text + "','" + this.TextBox5.Text + "','" + Class1.repString(this.WebEditor1.Text) + "','" + fname + "')";
int result;
result = new Class1().hsgexucute(sql);
if (result == 1)
{
后面还有 10 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
