|
The error message is quite clear: your application doesn't have permission to write to the HKEY_LOCAL_MACHINE hive of the registry.
Either change your code to read/write from a key under the HKEY_CURRENT_USER hive, or run your application with the elevated permissions required to write to the machine hive.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The application was running ok from the visual basic 2012. I have upgraded to visual basic 2013 , and after that I can't write anymore to this key.
and I run the application under an administrator account
modified 31-Mar-14 15:09pm.
|
|
|
|
|
It's nothing to do with the version of Visual Basic or .NET; your application simply doesn't have permission to write to the key.
Unless your application is running as a user with Local Administrator permissions with UAC elevation, you won't be able to write to the HKEY_LOCAL_MACHINE hive of the registry.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Ok , but I have noticed this problem after the upgrade process.
And I'm running my application as a Administrator user . ( if I use regedit , I can write to this key)
|
|
|
|
|
|
UAC is disabled on my computer
If I run the exe file outside the visual studio , I run with "run as administrator" everything is ok.
|
|
|
|
|
As far as I'm aware, that just means that applications which request elevation will automatically elevate without prompting. If your application doesn't request elevation, it will still be running as a standard user.
You can use Process Explorer[^] to determine whether your application is running elevated:
http://superuser.com/a/74521[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I check with Process explorer , and the application is running as standart user.
But how can I force the application , inside visual studio to run as Elevated ?
I repeat , that this problem appear immediatly after Visual basic upgrade from 2012 to 2013. After upgrade , I run my application inside visual basic , and I get this error.
|
|
|
|
|
|
in my manifest file , I try all these optons :
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
but still I can't read or write to the key.
|
|
|
|
|
Try running Visual Studio elevated before running your application.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hello !
I have 2 databases one of them is a empty database , and other has data.
Using SMO , how can I check that the second database has the same tables structure as the first database ?
Thank you !
|
|
|
|
|
|
i have created a project in vb6.0 with oracle database connection.
now, i want to copy it in a cd.,
i want to transfer the project to another system.,
how can i do this?
|
|
|
|
|
Create an installation for it. You can TRY to use the Setup and Deployment wizard, but since VB6 is so old, I have seen that the resulting installer doesn't work so good on todays operating systems.
The installer is creates also looks VERY dated. You'd be better of creating an installation from scratch using a newer installation creation app, like InstallShield.
VB6 is so old now that it's not supported. You shouldn't have started new development work in it and used Visual Studio VB.NET Express (or higher) instead.
|
|
|
|
|
Hi,
I am dealing with an old FTPS server. (not to be mistaken for SFTP)
I can connect to it using LibCurlNet. (couldn't get it to work with .net's FtpWebRequest / FtpWebResponse)
using the following code:
With easy
.SetOpt(CURLoption.CURLOPT_URL, _URI)
.SetOpt(CURLoption.CURLOPT_SSL_VERIFYPEER, False)
.SetOpt(CURLoption.CURLOPT_SSL_VERIFYHOST, False)
.SetOpt(CURLoption.CURLOPT_FTP_SSL, CURLftpSSL.CURLFTPSSL_TRY)
.SetOpt(CURLoption.CURLOPT_DEBUGFUNCTION, New Easy.DebugFunction(AddressOf GetFileList))
.SetOpt(CURLoption.CURLOPT_VERBOSE, True)
.SetOpt(CURLoption.CURLOPT_FTPLISTONLY, True)
Dim code As CURLcode = .Perform()
If code = CURLcode.CURLE_OK Then
If blnFileListSuccess Then
If file_list.Count > 0 Then bResult = ProcessResults.AllroundSuccess
End If
Else
bResult = ProcessResults.FTPConnectionFailure
End If
.Cleanup()
End With
(with adaptations for each action of course)
I can list files.
I can download files.
I can upload files.
But I cannot delete files.That is, I don't know how to do it with LibCurlNet.
So my question is this, can anyone tell me how to delete files from an ftp server using LibCurlNet ?
Or alternatively, can anyone tell me how to connect to, and interact with, FTPS using normal .net ?
All help much appreciated.
Regards,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Since it's extremely unlike you're going to run into anyone who has used that library here, I suggest you ask in a forum dedicated to that library. Click here[^].
|
|
|
|
|
Thanks Dave, you are right of course, but I had to try everything.
Regards,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
I want use some matlab function in vb. How to connect matlab to vb? and How to use that function. Thx.
|
|
|
|
|
Google for "VB6 MatLab" and start reading.
|
|
|
|
|
Hello !
When adding a image to a form , there are 2 options to choose : Form resurcees and Project resources.What are the differences and how to choose ?
Thank you !
|
|
|
|
|
You use Form resources usually to provide localization for a specific form. so you get a set of resource files for each form making it easier for you to maintain them and VS already provides some mechanisms that automate the localization for you that way.
project resources should be used for things that aren't bound to a specific form but are used in the whole application. A good example would be error messages.
For a bit more information about localization take a look at Walkthrough: Localizing Windows Forms[^] or search through the articles on codeproject about localization.
I hope this helps 
|
|
|
|
|
I written a ProcessUtility class that allows me to call a process (which in turn runs a commandline executable) asynchronously. The process then raises events indicating completion, progress, etc.
When the ProcessUtility class is set up from the UI form as:
dim WithEvents P as ProcessUtility_Class
P.Start
All runs as expected. Events are raised appropriately and, as expected, they are on a different thread from the UI and calls to the UI controls must be invoked to avoid cross-threading errors.
I've been reading up on async, synchronization contexts and other threading concepts to better understand the issues. While I can (and have) wrapped every UI call within the events, it seems very redundant to have to do it every time a UI element is utilized. Since the problem isn't really the UI, but the Asynchronous process that is raising events in the "wrong" thread to the UI, it seems that there should be a (better) way to have my ProcessUtility class raise it's events within the threading context of the UI (if desired). That way, only the few events are specialized and whatever happens within them is UI-threadsafe. Perhaps something along the lines of (pseudocode):
ProcessUtility_Class
Public Event Process_Started(ThisProcess as sender, SecondArg as string)
Public sub Start(Form1)
Form1.StartInvoke 'Everything from here until endinvoke happens within the MyForm thread
RaiseEvent Process_Started(blah, blah)
Form1.EndInvoke
DoStuffAsynchronously
End Sub
Is there something like this that can be done that the raised events are always running in the context of the main form that created the ProcessUtility_Class object in the first place? My goal is to avoid having to continuously wrap every UI call with delegates and invokes.
|
|
|
|
|
What about using a BackgroundWorker for the background task? The ProgressChanged event will be sent to the correct thread, and you could use the Object userState parameter for your specific parameters. But in the end, that might create a different overhead for your events and look like just another WTF...
|
|
|
|
|
A BackgroundWorker would give similiar function, but I have several more events that BGW supports. And although I probably could inherit a class using BGW, I'd really like to learn the methodology myself and incorporate it into my objects.
|
|
|
|