新灵感站族管理系统 API接口 (ASP版)示例下载及代码说明
新灵感 站族网站群管理 系统功能简介:
详细资料请查询 新灵感官网站网站:http://www.xinlg.com/
站族管理系统登录地址:http://www.zhanzu.net/
以下是ASP接口的示例 完整版下载
Conn.asp
<%
'数据库链接
IsSqlDataBase=0
If IsSqlDataBase=0 Then
SqlDataBase = "/main/inc/#Com.com$Admin^@2010_baopo.mdb"
SqlProvider = "Microsoft.Jet.OLEDB.4.0"
Connstr="Provider="&SqlProvider&";Data Source="&Server.MapPath(SqlDataBase)
SqlNowString="Now()"
SqlChar="'"
IsSqlVer="ACCESS"
Else
SqlLocalName="(local)"
SqlUserName =""
SqlPassword =""
SqlDataBase =""
SqlProvider ="SQLOLEDB"
ConnStr="Provider="&SqlProvider&"; User ID="&SqlUserName&"; Password="&SqlPassword&"; Initial CataLog="&SqlDataBase&"; Data Source="&SqlLocalName&";"
SqlNowString="GetDate()"
IsSqlVer="MSSQL"
END IF
On Error Resume Next
Set Conn=Server.CreateObject("ADODB.Connection")
'========Conn.open ConnStr 使用时请启用该语句
If Err Then
Response.Write ""&IsSqlVer&"数据库连接出错,请检查连接字串。<br><br>"&Err.Source&" ("&Err.Number&")"
Set Conn = Nothing
err.Clear
Response.End
End If
%>
'数据库链接
IsSqlDataBase=0
If IsSqlDataBase=0 Then
SqlDataBase = "/main/inc/#Com.com$Admin^@2010_baopo.mdb"
SqlProvider = "Microsoft.Jet.OLEDB.4.0"
Connstr="Provider="&SqlProvider&";Data Source="&Server.MapPath(SqlDataBase)
SqlNowString="Now()"
SqlChar="'"
IsSqlVer="ACCESS"
Else
SqlLocalName="(local)"
SqlUserName =""
SqlPassword =""
SqlDataBase =""
SqlProvider ="SQLOLEDB"
ConnStr="Provider="&SqlProvider&"; User ID="&SqlUserName&"; Password="&SqlPassword&"; Initial CataLog="&SqlDataBase&"; Data Source="&SqlLocalName&";"
SqlNowString="GetDate()"
IsSqlVer="MSSQL"
END IF
On Error Resume Next
Set Conn=Server.CreateObject("ADODB.Connection")
'========Conn.open ConnStr 使用时请启用该语句
If Err Then
Response.Write ""&IsSqlVer&"数据库连接出错,请检查连接字串。<br><br>"&Err.Source&" ("&Err.Number&")"
Set Conn = Nothing
err.Clear
Response.End
End If
%>
Zhanzu.asp
<!--#include file="md5.asp"-->
<!--#include file="conn.asp"-->
<%
'=================你的帐户名称
SetUserName = "xinlg@163.com"
'=================所设置的站点的密码KEY 请对外保密 在管理系统编辑站点时可获取到。
SetKey = "C98BF1A9606FF525F84DEFEBD275A259"
'=================数据库链接字串 SQL Server
SetConnectionString = "Data Source=(local);Database=***;integrated security=true"
'=================用于给返回给服务器信息 0程序出错,或未知 1:成功 2:验证失败 3:数据无效
SetResultInfo = ""
'=================获取数据
Title = Request.Form("Title").Trim()
Keywords = Request.Form("Keywords").Trim()
Content = Request.Form("Content").Trim()
Source = Request.Form("Source").Trim()
ClassName = Request.Form("ClassName").Trim()
UserName = Request.Form("UserName").Trim()
Key = Request.Form("Key").Trim()
'=================程序入口开始
if ValidateUserName()=true then
if Title <> "" and Keywords <> "" and Content <> "" then
'====================根据模块分类名称获取站点数据中分类的ID
ClassId = 0
set rs_select = conn.execute("select top 1 Id from C_Site_Menu where Menu_Name='"&ClassName&"'")
if not se_select.eof and not se_select.bof then ClassId = rs_select(0)
rs_select.close
set rs_select = nothing
'====================插入数据
sql = "insert into C_Site_News(News_Classid,News_Name,News_Intro,News_date,News_Username) values("&ClassId&",'"&Title&"','"&Content&"','"&date(now)&"','"&UserName&"')"
set rs_add = conn.execute(sql)
rs_add.close
set rs_add = nothing
ResultInfo="1"
else
ResultInfo="3"
end if
else
ResultInfo="2"
end if
if ResultInfo="" then ResultInfo="0"
Response.Write(ResultInfo)
'==================验证用户信息
Function ValidateUserName()
if Key = UCase(MD5(SetKey,32)) and UserName = SetUserName then
ValidateUserName = true
else
ValidateUserName = false
end if
End Function
%>
<!--#include file="conn.asp"-->
<%
'=================你的帐户名称
SetUserName = "xinlg@163.com"
'=================所设置的站点的密码KEY 请对外保密 在管理系统编辑站点时可获取到。
SetKey = "C98BF1A9606FF525F84DEFEBD275A259"
'=================数据库链接字串 SQL Server
SetConnectionString = "Data Source=(local);Database=***;integrated security=true"
'=================用于给返回给服务器信息 0程序出错,或未知 1:成功 2:验证失败 3:数据无效
SetResultInfo = ""
'=================获取数据
Title = Request.Form("Title").Trim()
Keywords = Request.Form("Keywords").Trim()
Content = Request.Form("Content").Trim()
Source = Request.Form("Source").Trim()
ClassName = Request.Form("ClassName").Trim()
UserName = Request.Form("UserName").Trim()
Key = Request.Form("Key").Trim()
'=================程序入口开始
if ValidateUserName()=true then
if Title <> "" and Keywords <> "" and Content <> "" then
'====================根据模块分类名称获取站点数据中分类的ID
ClassId = 0
set rs_select = conn.execute("select top 1 Id from C_Site_Menu where Menu_Name='"&ClassName&"'")
if not se_select.eof and not se_select.bof then ClassId = rs_select(0)
rs_select.close
set rs_select = nothing
'====================插入数据
sql = "insert into C_Site_News(News_Classid,News_Name,News_Intro,News_date,News_Username) values("&ClassId&",'"&Title&"','"&Content&"','"&date(now)&"','"&UserName&"')"
set rs_add = conn.execute(sql)
rs_add.close
set rs_add = nothing
ResultInfo="1"
else
ResultInfo="3"
end if
else
ResultInfo="2"
end if
if ResultInfo="" then ResultInfo="0"
Response.Write(ResultInfo)
'==================验证用户信息
Function ValidateUserName()
if Key = UCase(MD5(SetKey,32)) and UserName = SetUserName then
ValidateUserName = true
else
ValidateUserName = false
end if
End Function
%>
更多的详细资料请参考 :
新灵感站族系统接口使用方式以及参数说明文档
http://www.xinlg.com/support/show/41.html