|
\d{2}-\d{4}-\d{2}.*SERVICES:\s?([\S]*)
This will match ==METERED== in a group, and match the rest before ( no grouping, as you didn't have any ). To make it work I turn on multiline AND single line modes.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
win32newb wrote:
Can someone please help me in understanding why this code will not work in visual basic .net 2003 ?
Because there is no Microsoft.VisualBasic.FileIO namespace in .Net 1.1.
Also, there is no 'My' pseudonamespace in .Net 1.1.
You will have to parse it yourself. If you know there won't be any commas in text fields, you can use String.Split to break it apart, then if the first char of a field is a double quote, you ignore the first and last char of the field. This could also probably be done with RegEx. If there might be commas in the text fields, then you have to be more carefull.
|
|
|
|
|
Thank you this is exactly what I was looking for. No the data will be generated from an access database file with comma delimiters and no valid data will have comma's. This will work perfectly.
Thanks once again. I will write back if i have more questions.
-tony-
Win32newb
"Programming is like sex, make one mistake and you have to support it for a long time"
|
|
|
|
|
I have a matter with Ms.Access. I don't know how to pass the value from one form to another form. Also, I want to set this value to the text-box of the destination form.
For example:
I'd like to transfer the value '5' inside the code VBA of the form 'form1' to the form 'form2'. After moving successfully, I want to show this value in a text-box of the destination form. Please point me to a way of solutions.
Thanks so much...
|
|
|
|
|
Private Sub cmdPassValue_Click()
UserForm2.TextBox1 = Me.TextBox1
End Sub
|
|
|
|
|
Hi my friends, I need some help for syncronizing date and time on terminal with VB.NET.
The idea is set the date and time on the terminal with WinCE. The values are taken of PC.
somebody can help me with this problem?
best regards...
|
|
|
|
|
I have an application which reads values from the registry, now when the app loads, if the values dont exist, I am thrown an exception. Is there any way to stop this exception or to catch it. Or can i perhaps make a function or use a Try statement?
|
|
|
|
|
try will obviously do it. Otherwise, break down your registry code so that you check that you find a key, for example, before looking for a subkey or value.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am relatively new to vb.net and c#, do you know of any source that could help me do the above??
|
|
|
|
|
Take your existing code, and break it down. Every part that has a return value, take it and check it for Nothing ( null in C# ) before using it in the next step. If you post your line of code, I'll show you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
k what I first did was:
Dim rk as RegistryKey = {Key Goes Here}
Dim value as rk.GetValue("Value To Get")
Now i would normally do this before showing the form. So i would put this above the Windows Designer Code.
I think that might be where my problem is, but am unsure what other code to use. I use vb.net but may try and move to c++ or c#, as I need to be able to access hardware.
|
|
|
|
|
andyr2005 wrote:
Dim rk as RegistryKey = {Key Goes Here}
if rk is not nothing
Dim value as rk.GetValue("Value To Get")
end if
something like that ( I don't do VB ). Your problem is that rk is nothing, because the key is not there, and you're trying to access it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
So if i do something on the form load like
Try
Dim rk as RegistryKey = {Key Goes Here}
if rk is not nothing
then
Do something
elsedim value as rk.getvalue(value to get)
end if
would i be heading in the right direction?
|
|
|
|
|
Yes, your core problem would be that 'value' is scoped inside the if/else, so if you use it outside, declare it before the if/else so it's in scope.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
dim value as byte()
Try
Dim rk as RegistryKey = {Key Goes Here}
if rk is not nothing
then
Do something
else
byte = rk.getvalue(value to get)
end if
Better??
|
|
|
|
|
It's backwards. Remove the not
dim value as byte()
Try
Dim rk as RegistryKey = {Key Goes Here}
if rk is nothing
then
Do something
else
byte = rk.getvalue(value to get)
end if
If it's NOT nothing, then you can use it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Cheers for that.
When I read a value that is binary, i cant out put to a label, but is it possible to check the value against 5 or 6 others and set a list box value depending on the outcome?
|
|
|
|
|
andyr2005 wrote:
When I read a value that is binary, i cant out put to a label, but is it possible to check the value against 5 or 6 others and set a list box value depending on the outcome?
I'm not sure what you're asking ? A binary value is a bool, or do you mean a value that is data other than a string ? You can certainly compare a value to a collection of values, if they are all of the same type or there is an acceptable conversion.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
K for example i read a value which is 'REG_BINARY' and the value can be 01 28 00 08 or 01 00 40 0a. I need to compare the current value to like a list of available values that can be set. Now if i need to convert, that is the part that i will definetly get lost in.
|
|
|
|
|
What sort of variable are you storing that in ? It looks like a byte [] to me.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i just used byte as an example, am not sure what to store it in
|
|
|
|
|
OK, well it looks like a byte [] to me, not sure how else you're store it. But if it's in the registry, the registry API will assign a return type. Whatever it is, store your values to compare as the same type, then you can compare them.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Cheers for the help, i use the following code now which works:
Try
audiospeakersrightclick = Registry.CurrentUser.OpenSubKey("SOFTWARE\NVIDIA Corporation\NvMixer\Profiles", True)
If audiospeakersrightclick Is Nothing Then
combospeaker1.SelectedIndex = 0
combospeaker2.SelectedIndex = 0
audiospeakers.CreateSubKey("Profiles")
End If
Catch ex As Exception
End Try
Many thanks again.
|
|
|
|
|
k sorry bout this but I am having the same problem when reading binary values from the registry. Here's the code I am attempting to use:
Dim showadvanced, showfirewall As Byte
Try
nvmixersettings = audiospeakers.OpenSubKey("Settings", True)
showadvanced = nvmixersettings.GetValue("ShowAdvanced")
showfirewall = nvmixersettings.GetValue("ShowFirewall")
If showfirewall = Nothing Then
soundstormadvancedenable.Checked = False
soundstormadvanceddisable.Checked = True
soundstormfirewallenable.Enabled = False
soundstormfirewalldisable.Enabled = False
GroupControl13.Visible = True
End If
If showfirewall = 10000000 Then
soundstormadvancedenable.Checked = True
soundstormadvanceddisable.Checked = False
soundstormfirewallenable.Enabled = True
soundstormfirewallenable.Enabled = True
GroupControl13.Visible = False
End If
Catch ex As Exception
End Try
Now i have tried to Declare the variable type to string and byte and still no good, any other ideas??
|
|
|
|
|
Hi, how can I use MS Scan Wizard in my app?
Can I use and assign parameters to it?
Thanks
|
|
|
|