易截截图软件、单文件、免安装、纯绿色、仅160KB

asp分行读取txt文件,有分隔符,存储到access

txt文件是下面这样的,
一行一条数据,用逗号分隔
下面写出asp文件
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--#include file="inc/conn.asp" -->
<%
filespec=server.mappath("txt.txt")
Const ForReading = 1
Dim fso, theFile, retstring
Set fso = CreateObject("Scripting.FileSystemObject")
Set theFile = fso.OpenTextFile(filespec, ForReading, False)
i=0
Do While theFile.AtEndOfStream <> True
session("line"&i) = theFile.ReadLine
i=i+1
Loop
theFile.Close
ReadEntireFile = retstring
for j=0 to i-1
arry=split(session("line"&j),",")
'arry(0),arry(1),arry(2)
'分别为:张三 男 30岁
'然后进行数据存储
set rs3=server.createobject("adodb.recordset")
sql="select * from keywords"
rs3.open sql,conn,3,3
rs3.addnew
rs3("text")=arry(0)
rs3("url")=arry(1)
rs3.update
response.write session("line"&j)+"<br>"
next
%>
原文地址:http://www.corange.cn/archives/2010/05/3626.html


相关文档:

asp #include命令

在编写ASP程序的时候,通常都会用到<!--#include virtual/file="path/filename"-->把一段相对独立的文件代码嵌套到当前页面中来。 
  使用"file"的时候,等号后面使用的是相对路径。使用"virtual"的时候,等号后面使用的是绝对路径。很多人都不知道virtual这个包含绝对路径。  ......

301重定向设置及程序代码实现全集(ASP|.NET|PHP|JSP)

首先申明:这个是我转载的,致力于为像我一样的新手提供帮助!
1、IIS下301设置 Internet信息服务管理器 -> 虚拟目录 -> 重定向到URL,输入需要转向的目标URL,并选择“资源的永久重定向”。
2、ASP下的301转向代码
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanent ......

在访问ASP网站页面时调用另一个网站页面内容


如果在一个网站的页面中想调用其他网站页面内容,直接用一下代码就ok,http://www.wanyusoft.com/index.asp 这个路径就是所要调用的页面路径。
<%
response.write(getHTTPPage("http://www.wanyusoft.com/index.asp"))
function getHTTPPage(url)
dim http
set http=createobject("MSXML2.XMLHTTP")
Http.o ......

C#生成com组件,供asp调用

C#生成com组件,供asp调用
一、vs2005—新建项目—C#类库
类库源码如下(包含接口,类,事件接口):
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data.SqlClient;
using System.Runtime.InteropServices;
namespace entryclass
{
   ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号