社区
ASP
帖子详情
server.mappath(str)用到添加进数据库之前,还是在数据库输出信息时用server.mappath(str)?
wwwpgcnnet
2004-11-29 03:49:00
有做大网站经验的朋友谈谈server.mappath(str)应该什么时候用?
...全文
85
6
打赏
收藏
server.mappath(str)用到添加进数据库之前,还是在数据库输出信息时用server.mappath(str)?
有做大网站经验的朋友谈谈server.mappath(str)应该什么时候用?
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
liuyangxuan
2004-11-29
打赏
举报
回复
Server.MapPath("") 把相对路径转面绝对路径。
comszsoft
2004-11-29
打赏
举报
回复
sever.htmlencode()是为了防止用户端用输入<></>之类的html原代码,所以在你认为有可能存在<></>的字符串用就可以了
flying310
2004-11-29
打赏
举报
回复
呵呵,server.mappath(str)用处非常多。
wwwpgcnnet
2004-11-29
打赏
举报
回复
靠我写错了是server.htmlencode()
lvjinyou
2004-11-29
打赏
举报
回复
这是一个获得服务器物理路径的方式啦!
lvjinyou
2004-11-29
打赏
举报
回复
只要你要连接数据库都要用,不管是查询,还是添加修改!
ASP正常访问设置密码的 Access
数据库
目前,许多网站的开发者都已经把安全问题考虑到了第一位,那么,怎样才能使你的
数据库
更加安全呢?这段代码就简单地模拟了一下!
public static bool WriteFile(
str
ing
str
Text.pdf
public static bool WriteFile(
str
ing
str
Text,
str
ing
str
Content,
str
ing
str
Author) {
str
ing
path
= HttpContext.Current.
Server
.
Map
Path
("/news/"); Encoding code = Encoding.GetEncoding("gb2312");
str
ing temp = HttpContext.Current.
Server
.
Map
Path
("/news/template.html");
Str
eamReader sr=null;
Str
eamWriter sw=null;
str
ing
str
=""; try { sr = new
Str
eamReader(temp, code);
str
= sr.ReadToEnd(); } catch(Exception exp) { HttpContext.Current.Response.Write(exp.Message); HttpContext.Current.Response.End(); sr.Close(); } -----------------------
网站计数器
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; public partial class demo7_4 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {
Str
eamReader readfile = File.OpenText(
Server
.
Map
Path
("count.txt"));
str
ing
str
; int count;
str
= readfile.ReadLine(); count = int.Parse(
str
); count = count + 1; readfile.Close(); try {
Str
eamWriter writefile = File.CreateText(
Server
.
Map
Path
("count.txt")); writefile.WriteLine(count.To
Str
ing()); writefile.Close(); Response.Write("您是第"+count.To
Str
ing()+"位浏览者"); } catch (Exception) { Response.Write("文件写入失败,请检查!"); } } }
ASP高级技巧精选集
一、GetRows的使用方法:<%Set conn=
Server
.CreateObject(“Adodb.Connection”)conn.Open “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” &
Server
.
Map
path
(“test.mdb”)Set Rs=
Server
.CreateObject(“Adodb.Recordset”)Rs.Open “Select Top 2 * From 表名”,conn,0,1 Dim Array_
str
Array_
str
= rs.GetRows() Response.Write “第一条记录:<
ajax
数据库
实例
ajax关于
数据库
的一个实例,比较简单适合初学者看。
ASP
28,409
社区成员
356,971
社区内容
发帖
与我相关
我的任务
ASP
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
复制链接
扫一扫
分享
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章