foreach unit in Application.Contents Response.Write unit&"<br/>" next foreach unit in session.Contents Response.Write unit&"<br/>" next
asp 遍历未知字段数表全部字段:
if(request("conn")=="") then MM_conn_STRING ="driver={SQL Server};server=127.0.0.1; uid=sa;pwd=xnqc@rongw147*%@;database=master" else MM_conn_STRING =request("conn") endif public conn set conn=server.CreateObject("ADODB.Connection") conn.open MM_conn_STRING if request("e")<>""then conn.execute(request("sql")) endif if request("r")<>""then Set rsnews = Server.CreateObject("ADODB.Recordset") rsnews.ActiveConnection = MM_conn_STRING rsnews.Source ="SELECT * FROM qclt.dbo.link ORDER BY bh" rsnews.CursorType =0 rsnews.CursorLocation =2 rsnews.LockType =1 rsnews.Open() whilenot rsnews.eof for i=0to rs.Fields.Count-1 response.Write rsnews.Fields(i).name&":"&rsnews.Fields(i).value&"<br>" next rsnews.movenext wend endif
asp 发送邮件 mail:
<% Dim StrHtml ="<html><head>" StrHtml = StrHtml &"<Title>Greeting</Title></head>" StrHtml = StrHtml &"<body>" StrHtml = StrHtml &"<p>How are you</p>" StrHtml = StrHtml &"<img src="Sample.jpg">" StrHtml = StrHtml &"</body>" Set ObjSendMail=CreateObject("CDONTS.NewMail") With ObjSendMail .From ="me@domain.com" .To ="receiver@domain.com" ' 設定傳送郵件格式為HTML .BodyFormat = CdoBodyFormatHtml ' 設定超連結基底 .ContentBase ="http://ww.anywhere.com" ' 設定郵件內容中所有URL的絕對會相對位址 .ContentLocation ="images/" .Subject ="Give you a Picture" .Body = StrHtml .Send EndWith '移除物件 Set ObjSendMail=Nothing %>
Asp 发送和接收数据:
var oXMLHTTP =new ActiveXObject("Microsoft.XMLHTTP"); oXMLHTTP.open("POST", "xml_handler.asp", false); oXMLHTTP.send(xml_to_send); 由于Request对象会实现IStream接口,所以你可以通过使用DOMDocument对象的load()方法来加载所要提交的XML: Dim oDOM Set oDOM = Server.CreateObject("MSXML2.DOMDocument") oDOM.load Request