Click here to Skip to main content
15,898,769 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help on FTP client server socket prog Pin
Ravi Bhavnani1-Feb-06 6:25
professionalRavi Bhavnani1-Feb-06 6:25 
Question[Message Deleted] Pin
somebody_tr1-Feb-06 4:48
somebody_tr1-Feb-06 4:48 
AnswerRe: Who Will Answer it? Pin
Ingo1-Feb-06 21:43
Ingo1-Feb-06 21:43 
QuestionProper usage of SqlCommand Pin
MrEyes1-Feb-06 4:48
MrEyes1-Feb-06 4:48 
AnswerRe: Proper usage of SqlCommand Pin
ToddHileHoffer1-Feb-06 5:17
ToddHileHoffer1-Feb-06 5:17 
GeneralRe: Proper usage of SqlCommand Pin
Colin Angus Mackay1-Feb-06 5:52
Colin Angus Mackay1-Feb-06 5:52 
GeneralRe: Proper usage of SqlCommand Pin
ToddHileHoffer1-Feb-06 6:33
ToddHileHoffer1-Feb-06 6:33 
QuestionHaving a problem with this byte array Pin
Tom Wright1-Feb-06 4:40
Tom Wright1-Feb-06 4:40 
I'm trying to string several arrays together. Here is my code.
<br />
		public void OnCreateMessage(string TermID, string AddressLine, string MessageText)<br />
		{<br />
		private byte[] HeaderBegin = new byte[]{0xFF, 0x00, 0xAA, 0x55, 0x00, 0x1E, 0x48, 0x02, 0x00, 0x01, <br />
									   0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, <br />
									   0x08, 0xD2, 0x00, 0x00, 0x00, 0x00};<br />
		private byte[] HeaderEnd = new byte[]{0x55, 0xAA, 0x00, 0xFF};<br />
<br />
			Encoding enc = Encoding.ASCII;<br />
			uint nTermID = (uint)Encoding.ASCII.GetByteCount(TermID);<br />
			uint nAddressLine = (uint)Encoding.ASCII.GetByteCount(AddressLine);<br />
			uint nMessageText = (uint)Encoding.ASCII.GetByteCount(MessageText);<br />
			string sMyMsg = TermID+ASCII.CR+ASCII.LF+AddressLine+ASCII.CR+ASCII.LF+MessageText;<br />
			byte[] myBytes = enc.GetBytes(sMyMsg);<br />
			byte[] MyMsg = new byte[30+nTermID+nAddressLine+nMessageText+4];<br />
<br />
			MyMsg = HeaderBegin;<br />
			myBytes.CopyTo(MyMsg, 26);<br />
			HeaderEnd.CopyTo(MyMsg, MyMsg.Length);<br />

However when I step thru my code there is nothing in the MyMsg. Am I doing something wrong?

Thanks for any suggestions.


Tom Wright
tawright915@yahoo.com
AnswerRe: Having a problem with this byte array Pin
Guffa1-Feb-06 6:50
Guffa1-Feb-06 6:50 
GeneralRe: Having a problem with this byte array Pin
Tom Wright1-Feb-06 8:59
Tom Wright1-Feb-06 8:59 
GeneralRe: Having a problem with this byte array Pin
S. Senthil Kumar1-Feb-06 18:52
S. Senthil Kumar1-Feb-06 18:52 
GeneralRe: Having a problem with this byte array Pin
Tom Wright2-Feb-06 4:20
Tom Wright2-Feb-06 4:20 
QuestionGUI Invokation problem Pin
rnvrnv1-Feb-06 4:38
rnvrnv1-Feb-06 4:38 
AnswerRe: GUI Invokation problem Pin
Tom Wright1-Feb-06 5:02
Tom Wright1-Feb-06 5:02 
GeneralRe: GUI Invokation problem Pin
rnvrnv1-Feb-06 22:11
rnvrnv1-Feb-06 22:11 
QuestionSecurity Error Pin
Drew McGhie1-Feb-06 4:16
Drew McGhie1-Feb-06 4:16 
QuestionStartup problem Pin
NewbieDude1-Feb-06 3:58
NewbieDude1-Feb-06 3:58 
Question[Message Deleted] Pin
cassie11-Feb-06 2:43
cassie11-Feb-06 2:43 
AnswerRe: why does my C# Code not work Pin
Dan Neely1-Feb-06 3:27
Dan Neely1-Feb-06 3:27 
GeneralRe: why does my C# Code not work Pin
cassie11-Feb-06 4:07
cassie11-Feb-06 4:07 
AnswerRe: why does my C# Code not work Pin
Guffa1-Feb-06 4:34
Guffa1-Feb-06 4:34 
GeneralRe: why does my C# Code not work Pin
cassie11-Feb-06 4:41
cassie11-Feb-06 4:41 
AnswerRe: why does my C# Code not work Pin
Guffa1-Feb-06 6:51
Guffa1-Feb-06 6:51 
GeneralRe: why does my C# Code not work Pin
cassie11-Feb-06 7:11
cassie11-Feb-06 7:11 
AnswerRe: why does my C# Code not work Pin
Michael P Butler1-Feb-06 4:50
Michael P Butler1-Feb-06 4:50 

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.