mastermind455
ISP
Hi together
I use the code below to write datas to 2 Files (.htaccess and .htpasswd (which wil be used by IISPassword to protect Folders)
------------------------------------------------------------
<%Set fso = Server.CreateObject("Scripting.FileSystemObject")
Dim oShell
Set oShell = CreateObject("WScript.Shell")
strName= Request.Form("Benutzername")
strPasswort= Request.Form("Passwort")
const conVirtualPath = ".htaccess"
const conVirtualPath1 = ".htpasswd"
strPhysPath = Server.MapPath(conVirtualPath)
strPhysPath1 = Server.MapPath(conVirtualPath1)
set file= fso.opentextfile(strPhysPath,2, TRUE)
file.Writeline ("AuthName ""Bitte einloggen""") & vbcrlf
file.Writeline ("""AuthUserFile """) & strPhysPath & vbcrlf
file.WriteLine ("require valid_user")
oShell.run "cmd /c c:\tools\userline.exe" & strName & strPasswort & strPhysPath1
------------------------------------------------------------
now my problem is, that only .htpasswd will be created, but with the wrong content
Content of .htpasswd:
AuthName "Bitte einloggen"
AuthUserFilee:\inetpub\
require valid_user
and between AuthUserFile and the letter e shoud a space otherwise the file won't work
whats wrong?
Thank you for your help
best regards
E.Altherr
I use the code below to write datas to 2 Files (.htaccess and .htpasswd (which wil be used by IISPassword to protect Folders)
------------------------------------------------------------
<%Set fso = Server.CreateObject("Scripting.FileSystemObject")
Dim oShell
Set oShell = CreateObject("WScript.Shell")
strName= Request.Form("Benutzername")
strPasswort= Request.Form("Passwort")
const conVirtualPath = ".htaccess"
const conVirtualPath1 = ".htpasswd"
strPhysPath = Server.MapPath(conVirtualPath)
strPhysPath1 = Server.MapPath(conVirtualPath1)
set file= fso.opentextfile(strPhysPath,2, TRUE)
file.Writeline ("AuthName ""Bitte einloggen""") & vbcrlf
file.Writeline ("""AuthUserFile """) & strPhysPath & vbcrlf
file.WriteLine ("require valid_user")
oShell.run "cmd /c c:\tools\userline.exe" & strName & strPasswort & strPhysPath1
------------------------------------------------------------
now my problem is, that only .htpasswd will be created, but with the wrong content
Content of .htpasswd:
AuthName "Bitte einloggen"
AuthUserFilee:\inetpub\
require valid_user
and between AuthUserFile and the letter e shoud a space otherwise the file won't work
whats wrong?
Thank you for your help
best regards
E.Altherr