Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# accessing a web service Pin
AspDotNetDev20-Aug-12 16:03
protectorAspDotNetDev20-Aug-12 16:03 
GeneralRe: C# accessing a web service Pin
classy_dog21-Aug-12 17:44
classy_dog21-Aug-12 17:44 
GeneralRe: C# accessing a web service Pin
AspDotNetDev21-Aug-12 18:49
protectorAspDotNetDev21-Aug-12 18:49 
AnswerRe: C# accessing a web service Pin
Pete O'Hanlon20-Aug-12 22:28
mvePete O'Hanlon20-Aug-12 22:28 
AnswerRe: C# accessing a web service Pin
jschell21-Aug-12 8:32
jschell21-Aug-12 8:32 
QuestionTOP-SECRET LDAP Pin
SFORavi20-Aug-12 11:41
SFORavi20-Aug-12 11:41 
AnswerRe: TOP-SECRET LDAP Pin
Dave Kreskowiak20-Aug-12 12:50
mveDave Kreskowiak20-Aug-12 12:50 
QuestionConvert dateTime components to hex then byte[] Pin
MichCl20-Aug-12 5:05
MichCl20-Aug-12 5:05 
I'm having a tough time converting month, day, and year into hex then byte[]. I did an internet search and I'm not finding anything that is similar enough to provide the link to. This is what I have so far from before I realized I needed the hex, but I do need the 2-digit mo/day/yr before it's hex. I'm a little confused about converting to hex since I would normally take the number and use ToString("X"), but it doesn't seem to apply here since I'm applying the formatting to get it to the 2-digit month, for example.

DateTime mfg = DateTime.Now;

C#
mfgDate_mo = new byte[mfg.ToString("MM").Length * sizeof(char)];//month
            convertStringToByteArr(mfg.ToString("MM"), ref mfgDate_mo);
            mfgDate_dy = new byte[mfg.ToString("dd").Length * sizeof(char)];//day
            convertStringToByteArr(mfg.ToString("dd"), ref mfgDate_dy);
            mfgDate_yr = new byte[mfg.ToString("yy").Length * sizeof(char)];//year
            convertStringToByteArr(mfg.ToString("yy"), ref mfgDate_yr);

C#
//convert string to byte array, not taking encoding into account
        private void convertStringToByteArr(String theString, ref byte[] theByteArr)
        {
            System.Buffer.BlockCopy(theString.ToCharArray(), 0, theByteArr, 0, theByteArr.Length);
        }

AnswerRe: Convert dateTime components to hex then byte[] Pin
Pete O'Hanlon20-Aug-12 5:32
mvePete O'Hanlon20-Aug-12 5:32 
GeneralRe: Convert dateTime components to hex then byte[] Pin
MichCl20-Aug-12 5:55
MichCl20-Aug-12 5:55 
GeneralRe: Convert dateTime components to hex then byte[] Pin
Pete O'Hanlon20-Aug-12 6:06
mvePete O'Hanlon20-Aug-12 6:06 
GeneralRe: Convert dateTime components to hex then byte[] Pin
MichCl20-Aug-12 7:04
MichCl20-Aug-12 7:04 
AnswerRe: Convert dateTime components to hex then byte[] Pin
SledgeHammer0120-Aug-12 6:42
SledgeHammer0120-Aug-12 6:42 
GeneralRe: Convert dateTime components to hex then byte[] Pin
MichCl20-Aug-12 7:37
MichCl20-Aug-12 7:37 
GeneralRe: Convert dateTime components to hex then byte[] Pin
DaveyM6920-Aug-12 11:12
professionalDaveyM6920-Aug-12 11:12 
GeneralRe: Convert dateTime components to hex then byte[] Pin
MichCl21-Aug-12 1:52
MichCl21-Aug-12 1:52 
GeneralRe: Convert dateTime components to hex then byte[] Pin
DaveyM6921-Aug-12 7:55
professionalDaveyM6921-Aug-12 7:55 
GeneralRe: Convert dateTime components to hex then byte[] Pin
MichCl21-Aug-12 8:47
MichCl21-Aug-12 8:47 
QuestionWPF: use enum as index for Binding Pin
LionAM19-Aug-12 23:38
LionAM19-Aug-12 23:38 
AnswerRe: WPF: use enum as index for Binding Pin
Pete O'Hanlon20-Aug-12 0:27
mvePete O'Hanlon20-Aug-12 0:27 
GeneralRe: WPF: use enum as index for Binding Pin
LionAM20-Aug-12 1:34
LionAM20-Aug-12 1:34 
GeneralRe: WPF: use enum as index for Binding Pin
Pete O'Hanlon20-Aug-12 1:37
mvePete O'Hanlon20-Aug-12 1:37 
GeneralRe: WPF: use enum as index for Binding Pin
LionAM20-Aug-12 1:47
LionAM20-Aug-12 1:47 
AnswerRe: WPF: use enum as index for Binding Pin
Eddy Vluggen20-Aug-12 0:48
professionalEddy Vluggen20-Aug-12 0:48 
GeneralRe: WPF: use enum as index for Binding Pin
LionAM20-Aug-12 1:41
LionAM20-Aug-12 1:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.