-
HELP!
I am making an ASP document that looks for an INI or a registry setting(on the server) and then changes what it says in the HTML. But Whenever I use VB Code to getsetting for registry, it doesnt work. Declaring the INI things doesnt work either. I am new to ASP and VB Script, so how would I go about doing this? Heres what I am trying to do:
Code:
Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lsString As Any, ByVal lplFilename As String) As Long
Public Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPriviteProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Tester
Public Sub Tester()
online = GetSetting("FWN Camline", "Setting", "Online", False)
if online = true then
response.write "Frankie's Webcam Server is currently ONLINE"
else
response.write "Frankie's Webcam Server is currently OFFLINE, please stay tuned."
end if
end sub
or
Code:
Tester
Public Sub Tester()
online = GetSetting("FWN Camline", "Setting", "Online", False)
if online = true then
response.write "Frankie's Webcam Server is currently ONLINE"
else
response.write "Frankie's Webcam Server is currently OFFLINE, please stay tuned."
end if
end sub
Now they both have GetSetting in which that is for registry, but the first one doenst declare the INI function.
-
Cant use API calls in VBScript and there is no built in INI support. Yoo need to look into doing it with the File Scripting Object. I dont have any code for this right now.
-
Compile the VB into a COM DLL and then call that with your ASP page.
-
Huh?:confused: Do I need Professional Edition of VB or somthing? I only have learning edition and I have NO idea what you are talking about.:confused:
-
You should get at LEAST the professional edition.
You can't do much with the learning edition. More specifically, you can't do what your trying to do.
Using a COM object/ActiveX dll is the answer.
-
Well I am 13 years old, with no job. Parents dont want to give money away! LEARNING EDITION WAS EXPENSIVE ENOUGH!!!!!!! Somebody make me one of those DLL thingys then if your going to help. I cannot afford Professional Edition!! So mr. rich guy, any other answers?:mad:
-
ok frankie, calm down, these people are trying to help you out, not make fun of your finacial status.
-
Here is something you can do.
Search your computer for a file called Registry.vbs
The code in that file will help you a lot. It is one of the samples which comes with Win98.
-
Also try this link
Hope that helped.
-
If I put the code into a VBS file the script works. But when I put it in the ASP file it gives me this error:
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/camstat.asp, line 13
I am using this code(it works in VBS Format, but not in ASP):
Code:
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
online = WshShell.RegRead("HKEY_USERS\.DEFAULT\Software\VB and VBA Program Settings\FWN Camline\Setting\Online")
msgbox online
if online = "True" then
MsgBox "Frankie's Webcam Server is currently ONLINE"
else
Msgbox "Frankie's Webcam Server is currently OFFLINE, please stay tuned."
end if
Any reason Why?
You can check out whats going on at:
http://home.fwnsoftware.com/camstat.asp
-
Thank you all very much. The script is up and running at: http://home.fwnsoftware.com/camstat.asp , Even though my netcam doesnt work anymore.