|
-
Apr 12th, 2001, 12:55 PM
#1
Thread Starter
Addicted Member
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.
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
Apr 12th, 2001, 01:05 PM
#2
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.
-
Apr 12th, 2001, 01:16 PM
#3
Black Cat
Compile the VB into a COM DLL and then call that with your ASP page.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Apr 12th, 2001, 01:20 PM
#4
Thread Starter
Addicted Member
Huh? Do I need Professional Edition of VB or somthing? I only have learning edition and I have NO idea what you are talking about.
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
Apr 13th, 2001, 12:51 PM
#5
Frenzied Member
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.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Apr 13th, 2001, 03:14 PM
#6
Thread Starter
Addicted Member
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?
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
Apr 13th, 2001, 08:55 PM
#7
Hyperactive Member
ok frankie, calm down, these people are trying to help you out, not make fun of your finacial status.
-
Apr 14th, 2001, 05:42 PM
#8
Addicted Member
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.
-
Apr 14th, 2001, 05:49 PM
#9
Addicted Member
Also try this link
Hope that helped.
-
Apr 14th, 2001, 11:30 PM
#10
Thread Starter
Addicted Member
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
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
Apr 15th, 2001, 07:07 AM
#11
Thread Starter
Addicted Member
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.
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|