473,503 Members | 479 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 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 OpenNETCF.Win32.Registry
Dim regkey As OpenNETCF.Win32.RegistryKey
Dim sReglocation As String = "Software\Microsoft\AirSync\Connection\"
Dim sKey As String = "LastActiveSyncTime"

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

mybyte = CType(Registry.CurrentUser.OpenSubKey(sReglocation ).GetValue(sKey),
Byte())
--
b
Nov 22 '05 #1
1 1434
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\Microsoft\AirSync\Connection"
Dim sKey As String = "LastActiveSyncTime"
Dim myValue As UInt32

myValue =
CType(Registry.CurrentUser.OpenSubKey(sReglocation ).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 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 OpenNETCF.Win32.Registry
Dim regkey As OpenNETCF.Win32.RegistryKey
Dim sReglocation As String = "Software\Microsoft\AirSync\Connection\"
Dim sKey As String = "LastActiveSyncTime"

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

mybyte = CType(Registry.CurrentUser.OpenSubKey(sReglocation ).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
2604
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...
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....
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...
5
1788
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
16292
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...
21
10758
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...
3
2068
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...
3
1786
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....
6
1670
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...
0
7203
marktang
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,...
0
7463
tracyyun
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...
0
5581
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,...
1
5017
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...
0
4678
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...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
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...

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.