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 1728 sashi 1,754
Recognized Expert Top Contributor
hi method,
try this method.. good luck to u my fren..
SaveString HKEY_CURRENT_US ER, "Software\xyz\" ,trim(Text6.Tex t), "nickname",(tri m(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 hierarchy of algebraic matrices with the
addition operation. Thus, I want to have a virtual base class
class Matr;
|
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 database into classes, which are used
throughout the application. I have made class collections which, upon reading
from the DB, create an instance of the class and store the DB values in
there temporarily. My problem is that if user1 looks at...
|
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 the key. How do I go about
insertint the installation path (folder only) to the file into the registery
on installation of the setup project?
Say my project was installe to "c:\program files\myproject"
I want to make a registry key string at...
|
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 question is about storing data in a database. Yes I understand that you
can link to a database in your program and read and write to the database
etc etc. Well, that's all find and dandy but what if the person you're
writing the application for...
|
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 its content to a php script.
The php script then runs an external process using exec (or passthru). This
is where the problems start.
| |
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 geting error!! could any one tell me how to delete entire key with its subkeys ?
I changed :
Private Sub Command3_Click()
|
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, "Application");
And I am getting the exception:
System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +48
|
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 registery, but I need to do this in
C#.
I know the path
HKLM\System\Controlset001\Control\Network\{4D36E972-........} is the same on
all my PC's but the folders beneth that path are all different from PC to
PC, and I want to go into each one and...
|
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: 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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |