473,395 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1432
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...

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.