473,569 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

registry bites

I'm accessing the registry to get the value of the LASTACTIVESYNCT IME stored
in bytes
I'm trying to use the following code below to achive this but I'm running
into
System.InvalidC astException. Do I need to put this into a byte array, then
convert it ... I don't know . Any help would be appreciated.

Dim ObjReg As OpenNETCF.Win32 .Registry
Dim regkey As OpenNETCF.Win32 .RegistryKey
Dim sReglocation As String = "Software\Micro soft\AirSync\Co nnection\"
Dim sKey As String = "LastActiveSync Time"

Dim mybyte As Byte()
''''Dim ByteArray() As Byte

mybyte = CType(Registry. CurrentUser.Ope nSubKey(sRegloc ation).GetValue (sKey),
Byte())
--
b
Nov 22 '05 #1
1 1441
OK so I have to use uInt32 to get the value

Dim ObjReg As OpenNETCF.Win32 .Registry
Dim regkey As OpenNETCF.Win32 .RegistryKey
Dim sReglocation As String = "Software\Micro soft\AirSync\Co nnection"
Dim sKey As String = "LastActiveSync Time"
Dim myValue As UInt32

myValue =
CType(Registry. CurrentUser.Ope nSubKey(sRegloc ation).GetValue (sKey), UInt32)
but the value's I'm retreiving are, for example
myValue =
2598258112 (which displays 11/9/04 5:08 pm in ActiveSync )
3628519744 (which displays 11/9/04 6:08 pm in ActiveSync )
1043552448 (which displays 11/9/04 6:10 pm in ActiveSync )

so any ideas on how I can get this value back to Date/Time format so I an
display it in my app?

thanks
B
"brharsh17" wrote:
I'm accessing the registry to get the value of the LASTACTIVESYNCT IME stored
in bytes
I'm trying to use the following code below to achive this but I'm running
into
System.InvalidC astException. Do I need to put this into a byte array, then
convert it ... I don't know . Any help would be appreciated.

Dim ObjReg As OpenNETCF.Win32 .Registry
Dim regkey As OpenNETCF.Win32 .RegistryKey
Dim sReglocation As String = "Software\Micro soft\AirSync\Co nnection\"
Dim sKey As String = "LastActiveSync Time"

Dim mybyte As Byte()
''''Dim ByteArray() As Byte

mybyte = CType(Registry. CurrentUser.Ope nSubKey(sRegloc ation).GetValue (sKey),
Byte())
--
b

Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2608
by: Rohit Santhanam | last post by:
As I am reading the .NET documentation, I get the feeling that Microsoft is trying to get rid of the registry. My understanding is that an application built using .NET does not use the registry at all. So, conceivably as applications are migrated to .NET, the registry could disappear in a future version of Windows. Does anybody out there...
1
353
by: brharsh17 | last post by:
I'm accessing the registry to get the value of the LASTACTIVESYNCTIME stored in bytes I'm trying to use the following code below to achive this but I'm running into System.InvalidCastException. Do I need to put this into a byte array, then convert it ... I don't know . Any help would be appreciated. Dim ObjReg As...
0
354
by: vincemoon | last post by:
Below is an excerpt from my Registry Log, created by Redmon, showing the process whereby TweakUI added the compressed folder option to the new sub-menu in the right click context menu for open folders and desktop. I hope someone can help me to better understand what this log excerpt means, or point me to info sources that do a good job of...
5
1792
by: Senger | last post by:
Hi. How I can Include or Extract bites in a binary file?? I'm tring to use a fopen method, but without success. Do you have any idea??? Thanks!!!
1
16302
by: rdavis7408 | last post by:
I have a database that has a form that opens a report using date parameters. I have been using it for six months and last week I began to get the following Error Message: "File sharing lock count exceeded. Increase MaxLocksPerFile registry entry." I checked in the Tools - Options - Advance. I have the database shared with no locks...
21
10784
by: Kevin Swanson | last post by:
I'm attempting some remote registry manipulation via C#. I've written a test app to simply grab a specified key from a specified hive on a specified machine. The call to OpenSubKey is throwing System.SecurityException. Also of note: Sitting at my local box, I can open regedit and connect to the remote registry. I see three hives:...
3
2083
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Is there a way to create a registry key, but orphan it from the program that created it? Reason: Create a key, but not associate it with the program, so that the program can check for that key to see if the product has been installed and stop a second installation or illegal installation. ...
3
1789
by: Aussie Rules | last post by:
Hi, I want to store some data in the registry, however I have not been able to do this, and think my logic maybe flawed. Firstly I try to open the registry and read in any existing values. Dim aKey As RegistryKey aKey = Registry.CurrentUser.OpenSubKey("software\myApplication") I then attempt to read in any existing values
6
1673
by: JOSII | last post by:
Getting a string of boolean value into and out of the registry is no problem. Here's the problem: Although you can place an object into the registry and retreive it, I need to place an ArrayList object with 10 string items into the registry and retreive them later. I tried this: key.SetValue("lstNSXitems", lstNSX.Items) where...
0
7924
Oralloy
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. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
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...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
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
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.