Hi all i am usiing this code to write mulitiple values to registery but it only write one value. could any one help me make this code so that it write multiple values to registery. Currently it only writes nickname but not pwd value!!
I tried this but gave me error : -
-
'Save the value to the registry
-
SaveString HKEY_CURRENT_USER, "Software\xyz\" + Text6.Text, "nickname",+Text7.Text "pwd", strString
-
-
complete code : -
-
Const REG_SZ = 1 ' Unicode nul terminated string
-
Const REG_BINARY = 3 ' Free form binary
-
Const HKEY_CURRENT_USER = &H80000001
-
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
-
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
-
Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
-
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
-
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
-
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
-
-
-
-
-
Sub SaveString(hKey As Long, strPath As String, strValue As String, strData As String)
-
Dim Ret
-
'Create a new key
-
RegCreateKey hKey, strPath, Ret
-
'Save a string to the key
-
RegSetValueEx Ret, strValue, 0, REG_SZ, ByVal strData, Len(strData)
-
'close the key
-
RegCloseKey Ret
-
End Sub
-
Sub SaveStringLong(hKey As Long, strPath As String, strValue As String, strData As String)
-
Dim Ret
-
'Create a new key
-
RegCreateKey hKey, strPath, Ret
-
'Set the key's value
-
RegSetValueEx Ret, strValue, 0, REG_BINARY, CByte(strData), 4
-
'close the key
-
RegCloseKey Ret
-
End Sub
-
-
Private Sub Command14_Click()
-
'Dim strString As String
-
Dim strString As String
-
'Ask for a value
-
'strString = InputBox("Please enter a value to be saved as a binary value in the registry.", App.Title)
-
-
-
'Save the value to the registry
-
-
- SaveString HKEY_CURRENT_USER, "Software\xyz\" + Text6.Text, "nickname", strString
-
-
' SaveString HKEY_CURRENT_USER, "Software\xyz\" + Text6.Text, "nickname",+Text7.Text, "pwd", strString ===> did not work
-
-
-
End Sub
-
-
1 1715
hi method,
try this method.. good luck to u my fren..
SaveString HKEY_CURRENT_USER, "Software\xyz\",trim(Text6.Text), "nickname",(trim(Text7.Text), "pwd", strString
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Leslaw Bieniasz |
last post by:
Cracow, 20.09.2004
Hello,
I need to implement a library containing a hierarchy of classes
together with some binary operations on objects. To fix attention,
let me assume that it is a...
|
by: jsale |
last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app
i have made is running on IIS v6 and consists of a number of pages that allow
the user to read information from the...
|
by: Brian Henry |
last post by:
I am trying to deploy my VB.NET project with a setup project, and I need to
make a reg key entry.. but it also needs to have the path to where the
program was installed in they string i placed in...
|
by: Chris Springer |
last post by:
I'd like to get some feedback on the issue of storing data out to disk and
where to store it. I've never been in a production environment in
programming so you'll have to bear with me...
My...
|
by: a |
last post by:
Hi everybody,
I have the following setup:
- Windows XP Pro with SP2 and all updates installed
- Apache 2.054
- PHP 4.4.x (not sure if 1 or 2)
My app consists in a html form page which sends...
|
by: method |
last post by:
I am trying to delete registery key encluding all its subkeys . I want to delete the bold part
HKEY_CURRENT_USER, "Software\xyz\foldername\"
using an api that i found on the net but i keep...
|
by: David Thielen |
last post by:
Hi;
I am trying to write to the event log using:
public const string EVENT_LOG_NAME = "Windward Portal";
if (!EventLog.SourceExists(EVENT_LOG_NAME))
EventLog.CreateEventSource(EVENT_LOG_NAME,...
|
by: Jason |
last post by:
I've got 20 PC's that I need to change the Description/name field for each
NIC, and each PC has three NIC adapters (all PC's are the same Hardware). I
know how to change it maunaully in the...
|
by: John |
last post by:
Hi
This .net is driving me crazy!!
In VB6 I had a type which contained a couple of multi-dimentional arrays
which i used to create and read records:
Type AAA
:
Array1(10,10,2) as Integer
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |