I am very new to VBA programming , I have a VBA code that reads data from the INI file, the function is like this now my Boss asked me to go with registry ! Can somebody guide me what he meant ? I mean I give the input file,output file in INI file kept in some folder, but what's this registry ? How'd read put input,output file from registry?
I believe he's asking to migrate the INI to a collection of registry strings which can populate your program configuration directly from the registry rather than the INI file. To do this, read this article on creating New Registry Keys -> Here
But before you dive into messing with the registry, verify that is what your boss wants. Because messing with the registry can be a destructive end.
Steve McMahon wrote a great registry class for vb6. You can find it here. http://www.vbaccelerator.com/codelib/inireg/registry.htm
If you intend on using it with MS Access, you'll need to replace all occurrences of App.EXEName with CurrentProject.Name.
You'll want your app to have it's own node under HKEY_CURRENT_USER\Software.
Good luck, and be careful not to mess with any other registry keys.
Related
I'm currently using WiX in order to create an MSI which reads custom parameters set by the user in a .ini file, placed in the TempFolder.
However, it seems that WiX is only able to read .ini from the WindowsFolder, but the users can't write in it, so I stumble into this issue: either WiX cannot read the changes, or either the user cannot make the changes (of course copying the edited .ini into the WindowsFolder doesn't work either since WiX cannot read it in first case).
While searching I found this Get INI file value with WiX but unfortunately I have absolutely no idea how to use or what are custom actions, and i'm having a hard time finding a begginer's guide for it.
Is there another bypass or can you please provide an easy step by step tutorial in order to read .ini values from anywhere ?
Thanks in advance, I will be very grateful for your help.
I want to know who (Windows username)created and who have modified a particular qlikview file. I have checked the xml files created from the qvw file using the -prj method, but there is nothing related to that. There is also a file with .dat extension which might have storing this information. Can anyone help me in reading that dat file.
A better way of doing this in the future is to implement a source control system, you are out of luck with Qlikview as it does not capture this information.
The author and/or last changed user name is not part of the default
metadata inserted into the document. So unless something similar to
the suggestions above was already in the document, there will be no
way of determining who was responsible.
Source
A better place to look is your windows environment and see if the information is held in a back-up.
My problem should be plain and simple to solve, but google is not helping me today.
I need to read/write a configuration file (config.xml) and, as i see so much problems with permissions with special folders, i decided for myDocuments.
Now, from File system (Setup), I added a custom special folder (myDocuments)
added a subfolder (g1OKweb) inside myDocuments
added the file (config.xml) inside g1OKweb
What I expect, reading around, is that during the installation g1OKweb should be created if not existing or older, and the same for config.xml, but it isn't.
Does someone have any clue?
Thanks in advance
Use Directory.CreateDirectory to create the directory before attempting to access the file. This will automatically create all parts of the path that do not yet exist. If the full path already exists, it will do nothing.
When opening the file, use a FileStream constructor overload that allows you to specify FileMode.OpenOrCreate. This will succeed regardless of whether the file already exists or not.
When you have opened the file, check to see if it is empty before parsing it. If it is empty, insert your XML root element first.
I'm working on finding a way to monitor a folder's files.
I want to get information on what files are used the most in a folder.
I've looked into using vb.net FileSystemWatcher but it doesn't seem to contain any classes for this. The articles I've found don't mention anything functions like this. I found one forum that said to use the timestamp from LastAccess in FileSystemWatcher. But the description doesn't really match that function.
Is there a way in vb.net to do this?
The FileSystemWatcher is indeed the class you want to use.
The msdn documentation contains an example of how to use it.
Just ensure you are setting the NotifyFilter to use the LastAccess filter:
watcher.NotifyFilter = NotifyFilters.LastAccess
This way you could create an application or service that monitors your folder and count how often each file is accessed.
But to have this work, you have to have the Last Access Time functionality enabled. By default, this is disabled on Windows Vista and up.
You can enable/disable this by either using this registry key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisableLastAccessUpdate
or by simply running
fsutil behavior set disablelastaccess 0
from a command prompt with administrator rights.
I didn't see a question on this subject in the archives, so here goes: For those of you experienced Mercurial users, is this a correct .hgignore file to tell VB.Net Express to ignore files/sub-dirs when adding items in a new repository?
bin
obj
temp
*.user
*.suo
*.ncb
Thank you.
well you either need to start each line with glob: or have the first line
syntax:glob
mine (for C#) has Thumbs.db as well.
edit: you can also set up a global ignore list using your global hgrc