如何将sqlserver数据库表中保存的图片读出并显示在web页面呢?

III_dont_know 2004-12-24 10:46:08
imgId imgfilename imgdata
1 aaa.jpg <Binary>
2 bbb.jpg <Binary>
3 ccc.jpg <Binary>
上边是一个数据库表中所存的信息,其中imgfilename为图片名称,imgdata为图片内容

现在客户端.aspx页面中有一个Button1,这个按钮被按下后,首先保存客户端机器中一张所选的图片到服务器数据库中,然后,再读取数据库中的这张图片,显示回客户端机器的屏幕。
下边的代码,只能写数据库,不能读数据库中的图片显回客户端,请高人指点

private void Button1_Click(object sender, System.EventArgs e)
{
if(File1.PostedFile.FileName!="")
{
string fileName=File1.PostedFile.FileName;
fileName=fileName.Substring(fileName.LastIndexOf(@"\"));
string[] s=fileName.Split('\\');
int fileLength=File1.PostedFile.ContentLength;
byte[] imgbuffer = new byte[fileLength];
Stream objStream;
objStream = File1.PostedFile.InputStream;
objStream.Read(imgbuffer,0,fileLength);
SqlConnection conn=new SqlConnection("Data Source=server1;"+"Initial Catalog=testdb;User ID=sa;Password=");
string insertimg="insert into InImage values('"+s[1].ToString()+"','"+fileLength.ToString()+"','"+imgbuffer+"')";
SqlCommand smcmd=new SqlCommand(insertimg,conn);
conn.Open();smcmd.ExecuteNonQuery();conn.Close();
string selectimg="select * from InImage where imagename='"+s[1].ToString()+"'";
SqlCommand secmd=new SqlCommand(selectimg,conn);
conn.Open();
SqlDataReader SqlReader = secmd.ExecuteReader();
   SqlReader.Read();
Response.ContentType="application/octet-stream";
Response.BinaryWrite((byte[])SqlReader["imagedata"]);
Response.End();
conn.Close();
}
}
...全文
866 40 打赏 收藏 转发到动态 举报
写回复
用AI写文章
40 条回复
切换为时间正序
请发表友善的回复…
发表回复
阿牛在线 2004-12-28
  • 打赏
  • 举报
回复
To lhdjk(耗子):
兄弟,你保存图片的时候要把图片类型保存到数据库中:
如用File控件的例子:string imgtype = File1.PostedFile.ContentType;
在数据表中建立字段如:imgtype nvarchar(30)
把这个imatype保存到表中建立的字段中:
首先查询出该记录存入
DataView Dv;
Dv=...//读数据库;
Response.ContentType = Dv[0]["imgtype"].ToString();
Response.BinaryWrite( (byte[])Dv[0]["imgdata"] );
就行了
lhdjk 2004-12-28
  • 打赏
  • 举报
回复
是不是一定要将这个contentType存入数据库表呢?如果不存入,就没法显示吗?
III_dont_know 2004-12-28
  • 打赏
  • 举报
回复
存入的contentType是什么,我先选取一张.jpg的图片后,用
this.Page.RegisterStartupScript("a","<script>alert('"+File1.PostedFile.ContentType.ToString()+"')</script>");

检查出来是:image/pjpeg
为什么是pjpeg呢?你的是吗?
tinghuyang 2004-12-28
  • 打赏
  • 举报
回复
up
sundy1115 2004-12-28
  • 打赏
  • 举报
回复
AddPersonPhoto方法是页面文件中的添加按钮需调用的方法。
sundy1115 2004-12-28
  • 打赏
  • 举报
回复
//用File Field控件添加照片
private void AddPersonPhoto(string id)
{
PersonPhotoManager ppm=new PersonPhotoManager();
string file=this.File1.PostedFile.FileName;
if(file=="")
{
return;
}
if(File1.PostedFile.ContentType.IndexOf("image",0,File1.PostedFile.ContentType.Length)==-1)
{
return;
}
int l=File1.PostedFile.ContentLength;
byte[] data=new byte[l];
this.File1.PostedFile.InputStream.Read(data,0,l);
string type=File1.PostedFile.ContentType;
try
{
ppm.AddPhoto(id,data,type);
}
catch(Exception ee)
{
//
}
}
再写一个PersonPhotoManage类
其中的Add方法如下:
public void AddPhoto(string personID,byte[] data,string contentType)
{
bool ab=this.IsPhoto(personID);
int maxlength=102400;//100kb
if(data.Length>maxlength)
{
throw new Exception("上传文件过大");
}

SqlCommand cmd=new SqlCommand();
cmd.Connection=conn;
cmd.CommandText="INSERT INTO PersonPhoto (PersonID,ImageData,ImageSize,CreateTime,ContentType) values (@PersonID,@ImageData,@ImageSize,@CreateTime,@ContentType)";

SqlCommand ucmd=new SqlCommand();
ucmd.Connection=conn;
ucmd.CommandText="update PersonPhoto set ImageData=@ImageData,ImageSize=@ImageSize,CreateTime=@CreateTime,ContentType=@ContentType where PersonID=@PersonID";

cmd.Parameters.Add("@PersonID",System.Data.SqlDbType.VarChar);
cmd.Parameters.Add("@ImageData",System.Data.SqlDbType.Image);
cmd.Parameters.Add("@ImageSize",System.Data.SqlDbType.Int);
cmd.Parameters.Add("@CreateTime",System.Data.SqlDbType.DateTime);
cmd.Parameters.Add("@ContentType",System.Data.SqlDbType.VarChar);

cmd.Parameters["@PersonID"].Value=personID;
cmd.Parameters["@ImageData"].Value=data;
cmd.Parameters["@ImageSize"].Value=data.Length;
cmd.Parameters["@CreateTime"].Value=DateTime.Now;
cmd.Parameters["@ContentType"].Value=contentType;
conn.Open();
try
{
{
cmd.ExecuteNonQuery();//insert


}
catch(Exception ee)
{
throw new Exception("图片更新错误,错误为:"+ee.Message);
}
finally
{
conn.Close();
}
}
我的数据库字段跟你不太一样,不过肯定能实现你的功能了。
III_dont_know 2004-12-28
  • 打赏
  • 举报
回复
使名扬的方法,还是只能在IE中打开一个没有图片的页只显示:
System.Byte[]

请再指点,下边是我库表的结构,没有生成ID号,只有image的名称如:"Blue hills.jpg";
CREATE TABLE [dbo].[InImage] (
[imagename] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[imagelength] [bigint] NOT NULL ,
[imagedata] [image] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ReadImage.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Data.SqlClient;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace WebApp1
{
/// <summary>
/// ReadImage 的摘要说明。
/// </summary>
public class ReadImage : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
string strImageID = Request.QueryString["id"];
SqlConnection conn=new SqlConnection("Data Source=hkserver;Integrated Security=SSPI;Initial Catalog=useraccounts;User ID=sa;Password=");
SqlCommand myCommand = new SqlCommand("Select imagedata from InImage Where imagename='"
+ "Blue hills.jpg'", conn);
try
{
conn.Open();
byte[] img=(byte[])myCommand.ExecuteScalar();
Response.ContentType = "image/jpeg";
Response.OutputStream.Write(img,0,img.Length);
conn.Close();
}
catch (SqlException SQLexc)
{
}
Response.End();
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}


Truly 2004-12-28
  • 打赏
  • 举报
回复
最后发1次

ReadImage.aspx.cs

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

namespace WebApp1
{
/// <summary>
/// ShowPhoto 的摘要说明。
/// </summary>
public class ReadImage : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
string id = "";
if( Request.QueryString["id"] != null && Request.QueryString["id"] != "")//注意这里必须先对是否为null判断然后才能对是否为空串判断
id = Request.QueryString["id"];
else
Response.End();

SqlConnection conn = new SqlConnection("Data Source=hkserver;Integrated Security=SSPI;Initial Catalog=useraccounts;User ID=sa;Password=");
SqlCommand cmd = new SqlCommand ("select * from InImage where imagename = @imagename", conn);
cmd.Parameters.Add("@imagename", id);

conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
if(dr.Read())
{
Response.Clear();
Response.ContentType = dr["imagetype"].ToString();
Response.BinaryWrite((byte[])dr["imagedata"]);
}
conn.Close();
Response.End();
}

#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
Truly 2004-12-28
  • 打赏
  • 举报
回复
sure
HenryXiaoY 2004-12-28
  • 打赏
  • 举报
回复
今天在MSDN上看到类似问题。
III_dont_know 2004-12-28
  • 打赏
  • 举报
回复
<IMG src="ReadImage.aspx?id=1">
这句在页面打开的时候,它究竟会不会自动执行呢???
III_dont_know 2004-12-28
  • 打赏
  • 举报
回复
为什么还是不显示呀??????????????

IAmage.aspx.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>AImage</title>
<META content="Microsoft Visual Studio 7.0" name="GENERATOR">
<META content="C#" name="CODE_LANGUAGE">
<META content="JavaScript" name="vs_defaultClientScript">
<META content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<SCRIPT>

</SCRIPT>
</HEAD>
<BODY MS_POSITIONING="GridLayout">
<FORM id="AImage" method="post" encType="multipart/form-data" runat="server">
<IMG src="ReadImage.aspx?id=1"> <FONT face="宋体"><INPUT id="File1" style="Z-INDEX: 101; LEFT: 152px; POSITION: absolute; TOP: 171px" type="file" name="File1" runat="server"></FONT>
<asp:Button id="Button2" style="Z-INDEX: 103; LEFT: 424px; POSITION: absolute; TOP: 213px" runat="server" Text="Button"></asp:Button>   
<asp:button id="Button1" style="Z-INDEX: 102; LEFT: 419px; POSITION: absolute; TOP: 169px" runat="server" Text="确定"></asp:button></FORM>
</BODY>
</HTML>

IAmage.aspx.cs


ReadImage.aspx.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>ReadImage</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="ReadImage" method="post" runat="server">
<FONT face="宋体"></FONT>
</form>
</body>
</HTML>

ReadImage.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Data.SqlClient;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace WebApp1
{
/// <summary>
/// ReadImage 的摘要说明。
/// </summary>
public class ReadImage : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
if(Request.QueryString["id"]!="" && Request.QueryString["id"]!=null)
{
string id=Request.QueryString["id"];
SqlConnection conn=new SqlConnection("Data Source=hkserver;Integrated Security=SSPI;Initial Catalog=useraccounts;User ID=sa;Password=");
SqlCommand cmd = new SqlCommand ("select * from InImage where id = @id", conn);
//cmd.Parameters.Add("@id", id);
cmd.Parameters.Add("@id",id);

SqlDataAdapter dbas=new SqlDataAdapter(cmd);
conn.Open();
DataSet ds=new DataSet();
DataTable dt=new DataTable();
ds.Tables.Add(dt);
ds.Tables[0].TableName="dt";
dbas.Fill(ds,"dt");
//this.Page.RegisterStartupScript("a","<script>alert('"+dt.Rows.Count.ToString()+"');</script>");
Response.BinaryWrite((byte[])dt.Rows[0]["imagedata"]);
conn.Close();


Response.End();
}
else
{
// string id = Request.QueryString["id"];
this.Page.RegisterStartupScript("id","<script>alert('no id');</script>");
}
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
Truly 2004-12-28
  • 打赏
  • 举报
回复
string id = "";
if( Request.QueryString["id"] != null && Request.QueryString["id"] != "")
id = Request.QueryString["id"];
else
{
Respone.Write("你的值传过来了么?代码不是发给你了?自己对比一下!");
Response.End();
}
III_dont_know 2004-12-28
  • 打赏
  • 举报
回复
改为:
cmd.Parameters.Add("@id", id);
报错:
被准备语句 '(@id nvarchar(4000))select imagedata from InImage where id = @id' 需要参数 @id,但未提供该参数。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 被准备语句 '(@id nvarchar(4000))select imagedata from InImage where id = @id' 需要参数 @id,但未提供该参数。

Source Error:


Line 30: ds.Tables.Add(dt);
Line 31: ds.Tables[0].TableName="dt";
Line 32: dbas.Fill(ds,"dt");
Line 33: this.Page.RegisterStartupScript("a","<script>alert('"+dt.Rows.Count.ToString()+"');</script>");
Line 34: Response.BinaryWrite((byte[])dt.Rows[0]["imagedata"]);


Source File: d:\inetpub\wwwroot\webapp1\readimage.aspx.cs Line: 32

Truly 2004-12-28
  • 打赏
  • 举报
回复
cmd.Parameters.Add(new SqlParameter("@id", SqlDbType.Int,4)).Value = id;

改为:
cmd.Parameters.Add("@id", id);

III_dont_know 2004-12-28
  • 打赏
  • 举报
回复
AImage.aspx.html中
<IMG src="ReadImage.aspx?id=1">
ReadImage.aspx中

private void Page_Load(object sender, System.EventArgs e)
{
string id = Request.QueryString["id"];
SqlConnection conn=new SqlConnection("Data Source=hkserver;Integrated Security=SSPI;Initial Catalog=useraccounts;User ID=sa;Password=");
SqlCommand cmd = new SqlCommand ("select imagedata from InImage where id = @id", conn);
cmd.Parameters.Add(new SqlParameter("@id", SqlDbType.Int,4)).Value = id;
SqlDataAdapter dbas=new SqlDataAdapter(cmd);
conn.Open();
DataSet ds=new DataSet();
DataTable dt=new DataTable();
ds.Tables.Add(dt);
ds.Tables[0].TableName="dt";
dbas.Fill(ds,"dt");
this.Page.RegisterStartupScript("a","<script>alert('"+dt.Rows.Count.ToString()+"');</script>");
Response.BinaryWrite((byte[])dt.Rows[0]["imagedata"]);
conn.Close();


Response.End();
}

运行后报错:
被准备语句 '(@id int)select imagedata from InImage where id = @id' 需要参数 @id,但未提供该参数。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 被准备语句 '(@id int)select imagedata from InImage where id = @id' 需要参数 @id,但未提供该参数。

Source Error:


Line 35: ds.Tables.Add(dt);
Line 36: ds.Tables[0].TableName="dt";
Line 37: dbas.Fill(ds,"dt");
Line 38: this.Page.RegisterStartupScript("a","<script>alert('"+dt.Rows.Count.ToString()+"');</script>");
Line 39:
III_dont_know 2004-12-28
  • 打赏
  • 举报
回复
数据库表中一定要有一个int型的字段吗?

我用Truly(NULL)的方法,<IMG src="ShowPhoto.aspx?id=small.jpg">在另一页中接收,难道就不行吗???
Truly 2004-12-28
  • 打赏
  • 举报
回复

SqlCommand cmd = new SqlCommand ("select imgdata from 表名 where imgId= @imgId", conn);
cmd.Parameters.Add(new SqlParameter("@imgId", SqlDbType.Int,4)).Value = id;
(推荐)


SqlCommand cmd = new SqlCommand ("select imgdata from 表名 where imgfilename = @imgfilename", conn);
cmd.Parameters.Add(new SqlParameter("@imgfilename", SqlDbType.VarChar)).Value = id;

Truly 2004-12-28
  • 打赏
  • 举报
回复
显示页面要新建一个空白页(ShowPhoto.aspx),
showphoto.aspx.cs
private void Page_Load(object sender, System.EventArgs e)
{
string id = "";
if( Request.QueryString["id"] != null && Request.QueryString["id"] != "")
id = Request.QueryString["id"];
else
Response.End();

SqlConnection conn = new SqlConnection("server=.;database=northwind;uid=sa;pwd=xiaole;");
SqlCommand cmd = new SqlCommand ("select Photo from Employees where EmployeeID = @EmployeeID", conn);

cmd.Parameters.Add(new SqlParameter("@EmployeeID", SqlDbType.Int,4)).Value = id;

conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
if(dr.Read())
{
Response.Clear();
//Response.ContentType = "image/pjpeg";//指定类型或从数据库字段获取
Response.BinaryWrite((byte[])dr["Photo"]);
}
conn.Close();
Response.End();
}
Truly 2004-12-28
  • 打赏
  • 举报
回复
<%@ Page validateRequest=false language="c#" Codebehind="WebForm10.aspx.cs" AutoEventWireup="false" Inherits="DEMO1.WebForm10" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<TITLE>WebForm10</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<META content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<META content="C#" name="CODE_LANGUAGE">
<META content="JavaScript" name="vs_defaultClientScript">
<META content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<BODY ms_positioning="GridLayout">
<FORM id="Form1" method="post" runat="server">
<INPUT type="file" runat="server" id="File1"> <IMG src="ShowPhoto.aspx?id=1">
<ASP:BUTTON id="Button2" style="Z-INDEX: 101; LEFT: 296px; POSITION: absolute; TOP: 264px" runat="server"
text="Button"></ASP:BUTTON>
</FORM>
</BODY>
</HTML>

后台按钮事件:
private void Button1_Click(object sender, System.EventArgs e)
{
Stream imgStream;
int imgLen;

imgStream = File1.PostedFile.InputStream;
imgLen = File1.PostedFile.ContentLength;

byte[] imgBinaryData=new byte[imgLen];
imgStream.Read(imgBinaryData, 0, imgLen);

SqlConnection conn = new SqlConnection("server=.;database=northwind;uid=sa;pwd=xiaole;");
SqlCommand cmd = new SqlCommand ("update Employees set Photo = @photo where EmployeeID = @EmployeeID", conn);

cmd.Parameters.Add(new SqlParameter("@EmployeeID", SqlDbType.Int,4)).Value = 1; //指定更新的id
cmd.Parameters.Add("@Photo", SqlDbType.Image).Value = imgBinaryData;
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
}

显示页面:
string id = "";
if( Request.QueryString["id"] != null && Request.QueryString["id"] != "")
id = Request.QueryString["id"];
else
Response.End();

SqlConnection conn = new SqlConnection("server=.;database=northwind;uid=sa;pwd=xiaole;");
SqlCommand cmd = new SqlCommand ("select Photo from Employees where EmployeeID = @EmployeeID", conn);

cmd.Parameters.Add(new SqlParameter("@EmployeeID", SqlDbType.Int,4)).Value = id;

conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
if(dr.Read())
{
Response.Clear();
//Response.ContentType = "image/pjpeg";//指定类型或从数据库字段获取
Response.BinaryWrite((byte[])dr["Photo"]);
}
conn.Close();
Response.End();
加载更多回复(20)
Part1第一部分: 相信大家找得到该书的源代码部分 也就是这部分内容 因此我便无偿奉送 让大家下载试试。 若感觉可以方可继续下载电子书部分。 1.本书1~21章所附代码的运行环境 操作系统:Windows Server 2003或Windows XP Professional 开发环境:Microsoft Visual Studio 2005 数据库:SQL Server 2005 Web服务器:IIS 5.1及以上版本 2.本书所附光盘范例 第1章(\Chapter 01) 示例描述:本章演示ASP.NET 2.0网站的预编译以及学习ASP.NET 2.0的前置知识。 WebSite文件夹 创建的ASP.NET 2.0 Web站点。 www文件夹 第一个用C#开发的Web应用程序。 bianyi.bat 编译网站的批处理文件。 form.html 表单范例。 css.html CSS范例。 第3章(\Chapter 03) 示例描述:本章介绍C# 2.0程序设计基础。 3-01.cs 第一个C#程序。 3-02.cs 不导入命名空间来改写程序3-01.cs。 3-03.cs ReadLine()方法读数据。 3-04.cs 常量的使用。 3-05.cs 整型类型的使用。 3-06.cs 结构类型的使用。 3-07.cs 枚举类型的使用。 3-08.cs 用一个输入参数通过值传递一个变量给一个方法。 3-09.cs 一维数组的使用。 3-10.cs 使用代理类型。 3-11.cs 使用接口。 3-12.cs 装箱操作。 3-13.cs 字符串操作。 3-14.cs if语句的使用。 3-15.cs switch语句的使用。 3-16.cs while语句的使用。 3-17.cs do-while语句的使用。 3-18.cs for语句的使用。 3-19.cs 异常捕获:try-catch语句的使用。 3-20.cs 异常捕获:try-finally语句的使用。 3-21.cs 异常捕获:try-catch-finally语句的使用。 3-22.cs get和set对属性的值进行读写操作。 3-23.cs 方法的使用。 3-24.cs 继承演示。 3-25.cs 多态性演示。 第4 章(\Chapter 04) 示例描述:本章学习ASP.NET 2.0页面基本对象。 4-01.aspx aspx页面中添加一个Lable标签。 4-02.aspx 读出Application的属性值。 4-03.aspx 读出SessionID的值。 4-04.aspx 创建Session对象。 4-05.aspx 读取传递的Session值并显示。 4-06.aspx 使用Response对象的Write()方法。 4-07.aspx 使用Response对象的End()方法。 4-08.html 以post方式提交数据到4-08.aspx的表单。 4-08.aspx 接收表单数据并进行处理。 4

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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