473,657 Members | 2,484 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 1446
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
2613
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 agree with me? Of course, they might keep the registry for backward compatibility purposes.
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 OpenNETCF.Win32.Registry
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 explaining how to interpret exactly what the various phrases, words, and numbers in the log mean.
5
1798
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
16322
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 selected and record level locking selected.
21
10803
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: _CLASSES_ROOT, _LOCAL_MACHINE, and _USERS. I can open all but HKEY_LOCAL_MACHINE. When I try to expand that...
3
2085
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. If not orphan, can you encrypt the Key so that only your program can decrypt
3
1793
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
1678
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 "lstNSXitems" is the name of the subkey, and lstNSX.Items is the
0
8325
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8742
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8518
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5643
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
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

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.