Busca URLs en un texto y las convierte en un enlace con la URL como texto enlazable y sin title.
function SnTurls(texto) SnTurls = texto Set regx = New RegExp regx.Pattern = "http:\/\/[a-z]+\.[a-z]+\.[a-z]+\/" set matchs = regx.Execute(texto) for each match in matchs SnTurls = Replace(SnTurls, match, "<a href=""" & match & """>" & match & "</a>") next end function
Escribe aquí el texto
<% ' User Data strUserID="bob" strServer="server" strRoot="c:\inetpub\wwwroot\" strDomain=".somedomain.com" ' Create Users Folder Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.CreateFolder(strRoot&strUserID) ' Setup Connections To IIS set locatorObj = CreateObject("WbemScripting.SWbemLocator") set providerObj = locatorObj.ConnectServer(strServer,"root/MicrosoftIISv2") set serviceObj = providerObj.Get("IIsWebService='W3SVC'") ' Set Site Data Bindings = Array(0,0) Set Bindings(0) = providerObj.get("ServerBinding").SpawnInstance_() Bindings(0).IP = "" Bindings(0).Port = "80" Bindings(0).Hostname = strUserID&strDomain Set Bindings(1) = providerObj.get("ServerBinding").SpawnInstance_() Bindings(1).IP = "" Bindings(1).Port = "80" Bindings(1).Hostname = "www."&strUserID&strDomain 'Create & Start Site strSiteObjPath = serviceObj.CreateNewSite(strUserID, Bindings, strRoot&strUserID) Set objPath = CreateObject("WbemScripting.SWbemObjectPath") objPath.Path = strSiteObjPath strSitePath = objPath.Keys.Item("") Set serverObj = providerObj.Get(strSiteObjPath) serverObj.Start %>
-- Creamos una tabla if not objectproperty(object_id('Pruebas'),'IsTable') is null drop table pruebas go Create table pruebas (id int identity(1,1) not null primary key, descripcion varchar(50)) go if not objectproperty(object_id('spPruebas'),'IsProcedure') is null drop procedure spPruebas go create procedure spPruebas(@idDesde int = 0, @idHasta int=999999999) as begin select * from Pruebas where id between @idDesde and @idHasta end go -- Y le insertamos datos de prueba... Declare @i int set @i=1 while @i<50 begin insert into pruebas (descripcion) values('Insertamos fila'+ cast(@i as varchar(20)) ) set @i=@i+1 end go spPruebas go spPruebas 1,12 ' Ahora el código de V.B. Private Sub CargarDatos_Click() Dim Res As ADODB.Recordset Dim Conexion As String Conexion = "Provider=SQLOLEDB;Data Source=127.0.0.1;" & _ "User id=sa;Password=;Initial Catalog=pruebas" Set Res = New ADODB.Recordset Res.Open "spPruebas " & IIf(txtId.Text = "", "null", txtId.Text) & "," & _ IIf(txtidHasta.Text = "", "null", txtidHasta.Text), _ Conexion, adOpenForwardOnly, adLockReadOnly FlexDatos.Rows = FlexDatos.FixedRows Do Until Res.EOF FlexDatos.AddItem "" & Res!id & vbTab & Res!Descripcion Res.MoveNext Loop Res.Close Set Res = Nothing End Sub
Private Sub despliegaContactos(ByVal contactos As DataSet) dropdown.Items.Clear() dropdown.DataTextField = "Nombre" dropdown.DataValueField = "nContactoId" dropdown.DataSource = contactos.Tables(0) dropdown.DataBind() End Sub
ConnectionString = "DRIVER=SQL Server;SERVER=localhost;DATABASE=MasterDB;Address=127.0.0.1,1433;Trusted_Connection=Yes;" set conn = Server.CreateObject("adodb.connection") conn.open ct_ConnectionString conn.execute "INSERT ..." set rs = Server.CreateObject("adodb.recordset") rs.Open "SELECT ...", conn do until rs.eof rs.MoveNext: loop rs.Close set rs = Nothing conn.close set conn = Nothing
bSubmited = (Request.ServerVariables("REQUEST_METHOD")="POST") bFromHere1 = (InStr(Request.ServerVariables("HTTP_REFERER"), "contacto.asp")>0) bFromHere2 = (Request.ServerVariables("REMOTE_ADDR")=Session("cv")) bFromHere3 = (Request.ServerVariables("REMOTE_ADDR")=Request.Cookies("cv")) if not bSubmit then Response.Cookies("cv") = Request.ServerVariables("REMOTE_ADDR") Session("cv") = Request.ServerVariables("REMOTE_ADDR") end if if bSubmited and bFromHere1 and bFromHere2 and bFromHere3 then ' todo end if...