Name:nuet(守望麦田)
Mail:veryblog#gmail.com
QQ:6343436,63133434
Ture:看尽天下A片,心中自然无码
订阅到google了! 订阅到抓虾 订阅到雅虎 订阅到鲜果 有道 RSS订阅帮助
浏览模式: 标准 | 列表 全部文章

使用asp.net2.0或3.5编程加密、解密web.con...

ASP.NET Configuration API 提供了加密、解密web.config中的配置片段(sections)支持。这为您保护隐私信息(如密码)提供了极大的便利。这篇文章中,我们将讨论如何加密、解密web.config中的sections。

 有两种方法加密配置片段(sections),微软提供了两个providers:DPAPI(Windows Data Protection API)及RSA provider。其中RAS provider为默认。它使用RSA密钥,并拥有公钥和私钥。而DPAPI provider 则使用机器编译内规范密钥(built-in machine-specific key)。下面让我们使用RSA方法加密配置文件中的sections。

 

» Read more...
Tags: 解密, web.config, sections
技术文摘

asp简单加密及解密

1. 加密 .inc代码

<%
StrSQL="DBQ="+server.mappath("xxx.mdb")+";DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open StrSQL
sub CloseConn()
conn.close
set conn=nothing
end sub
function decrypt(dcode)
dim texts
dim i
for i=1 to len(dcode)
texts=texts & chr(asc(mid(dcode,i,2))-i)
next
decrypt=texts
end function
function encrypt(ecode)
Dim texts
dim i
for i=1 to len(ecode)
texts=texts & chr(asc(mid(ecode,i,2))+i)
next
encrypt = texts
end function
%>

 

» Read more...
Tags: asp, dcode, ecode
技术文摘

文章自动分页

比如本程序实现共四个文件:
分别如下:
数据库:data.mdb
表名:table
字段分别为:Id、Title、Content
注意:Content为类型为备注类型,SQL SERVER中为text类型
数据库接口文件:conn.asp
主显示页:show.asp
公共方法页:syscode.asp

» Read more...
Tags: 表名, 数据库, 字段, 分页
网站建站

IIS配置wap服务器,让ASP生成wml实战教

iis配置wap服务器,让ASP生成wml实战教程,让手机站点动起来

如果你想让你的IIS支持wml,做个wap网站,只需作小小的改变就行了.虽然目前支持wml的虚拟主机极少,但是自己在本机上玩玩也好的.
首先在打开IIS,然后在默认网站的属性--HTTP头--MMIE映射--文件类型--添加注册文件的类型:

Associated Extension MIME Type
wml text/vnd.wap.wml
wmlc application/vnd.wap.wmlc
wbmp image/vnd.wap.wbmp
wmlsc application/vnd.wap.wmlscriptc
wmls text/vnd.wap.wmlscript
wsc application/vnd.wap/wmlscriptc

现在你就可以在你的站点添加wml文件了.可以用手机模拟器来浏览,或者opera浏览器浏览.如果你的主机是对外发布的,那你就可以用手机来浏览你的网站了.

» Read more...
Tags: iis配置, wap服务器, wml实战教
技术文摘

asp新闻内容自动分页

<%
'连接数据库
dim conn,connstr
on error resume next

set conn=server.createobject("adodb.connection")
connstr="provider=microsoft.jet.oledb.4.0;Data source="&server.mappath("../data/#.mdb")
conn.open connstr

if err.number<>0 then
response.write err.description
err.clear
response.end
end if

sub connclose()
conn.close()
set conn=nothing
end sub

'读取数据:
dim rs,sql,content,title,newsid
id=request("id") '上页传来的ID值
set rs=server.createobject("adodb.recordset")
sql="select * from news where newsid="&id
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
content=rs("content") '读取内容
title=rs("title") '读取标题
end if

if err.number<>0 then
response.write err.description
err.clear
response.end
end if
rs.close
set rs=nothing

call connclose()
'分页处理部分
dim page,pagecount,thispage,linenum,allline
const pageline=10 '每页显示10行
linenum=split(content,"<br>") '计算机字符串<br>标记的个数
allline=ubound(linenum)+1 '全文<br>(换行标记)总数
pagecount=int(allline\pageline)+1 '计算总页数
page=request("page")

if isempty(page) then
thispage=1
else
thispage=cint(page)
end if

response.write "<b>"&title&"</b><hr>"
for i=0 to allline
if i+1>thispage*pageline-pageline and i<thispage*pageline then
response.write""&linenum(i)&"<br>" '输出分页后的内容
end if
next
response.write "<br><hr>"
response.write"<p align='center'>总共"&allline&"行"&pagecount&"页每页"&pageline&"行"
for i=1 to pagecount
if thispage=i then
response.write ""&i&" "
else
response.write"<a href='?page="&i&"&id="&id&"'>"&i&"</a>"
'输出所有分页链接
end if
next
%>

» Read more...
Tags: asp, 分页, 内容页分页
技术文摘


Menu

Blogroll

Google ADS