<html>
<frameset rows="60,*">
<frame name="say" src="say.asp">
<frame name="message" src="message.asp">
</frameset><noframes></noframes>
</html>
2.创建say.asp页面
<html>
<body>
<form name="form1" method="post" action="">
昵称:<input type="text" name="txtName" size="10">
发言:<input type="text" name="txtSay" size="30">
<input type="submit" value=" 发送 ">
</form>
<%
'如果提交了表单,就将发言内容添加到Application对象中
If Trim(Request.Form("txtName"))<>"" And Trim(Request.Form("txtSay"))<>"" Then
'下面先获取发言人的IP地址
User_ip=Request.ServerVariables("Remote_Addr")
'下面获取本次发言字符串,包括发言人和发言内容
Dim strSay
strSay="来自于"&User_ip&"的" &Request.Form("txtName") &"在" &Now()&"说:" &Request.Form("txtSay") &"<br>"
'下面将本次发言添加到聊天内容中
Application.Lock '先锁定
Application("strChat")=strSay &Application("strChat")
Application.Unlock '解除锁定
End if
%>
</body>
</html>
3.创建message.asp页面
<html>
<head>
<title>显示发言页面</title>
<meta http-equiv="refresh" content="5">
</head>
<body>
<% Response.Write Application("strChat") '显示聊天内容 %>
</body>
</html>
哎 兄弟 我搞个钓鱼网也快搞疯了 学好多东西 一下三剑客 一下E语言 到现在都不知道学那个好 买了域名金额FTP空间都不知道买来干什么 花了几百元 哎!听我的 好好去学怎么编代码吧! 没人给你代码的~using Systemusing System.Collections
using System.Configuration
using System.Data
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.Data.OleDb
using System.IO
/// <summary>
/// Product 的摘要说明
/// </summary>
public class Product : Page
{
public Product()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public void Add_product(string name, DateTime date, int visit, string path, string intro, string link)
{
try
{
OleDbConnection thisConnection = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0DATA Source=" + System.Web.HttpContext.Current.Server.MapPath("~/App_Data\\comdata.aspx"))//你的数据库
thisConnection.Open()
string str = "insert into Production (p_name,p_date,p_visit,p_path,p_intro,p_link) values('" + name + "','" + date + "','" + visit + "','" + path + "','" + intro + "','" + link + "')"
OleDbCommand npcd = new OleDbCommand(str, thisConnection)
npcd.ExecuteNonQuery()
thisConnection.Close()
((Page)HttpContext.Current.CurrentHandler).ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加服务信息成功!')", true)
}
catch (Exception e)
{
Response.Write(e.ToString())
//Server.Transfer("error.aspx")
}
}
public void Del_product(string name)
{
try
{
string path
OleDbConnection thisConnection = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0DATA Source=" + System.Web.HttpContext.Current.Server.MapPath("~/App_Data\\comdata.aspx"))//你的数据库
OleDbDataAdapter thisAdapter = new OleDbDataAdapter("select * from Production where p_name=" + "'" + name + "'", thisConnection)
OleDbCommandBuilder thisBuilder = new OleDbCommandBuilder(thisAdapter)
DataSet thisDataSet = new DataSet()
thisAdapter.Fill(thisDataSet, "Table_pro")
if (thisDataSet.Tables["Table_pro"].Rows.Count == 1)
{
path = System.Web.HttpContext.Current.Server.MapPath(@"~/Product_image\" + thisDataSet.Tables["Table_pro"].Rows[0]["p_path"].ToString())
FileInfo fi = new FileInfo(path)
fi.Delete()
FileInfo fi2 = new FileInfo(System.Web.HttpContext.Current.Server.MapPath(@"~/Product_intro\" + thisDataSet.Tables["Table_pro"].Rows[0]["p_link"].ToString()))
fi2.Delete()
thisDataSet.Tables["Table_pro"].Rows[0].Delete()
thisAdapter.Update(thisDataSet, "Table_pro")
}
thisConnection.Close()
((Page)HttpContext.Current.CurrentHandler).ClientScript.RegisterStartupScript(this.GetType(), "", "alert('删除服务信息成功!')", true)
}
catch
{
Server.Transfer("Error.html")
}
}
}
以前写的对数据可 *** 作的代码,你稍微改写就可以用了,希望对你有用
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)