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

C#

 
AnswerRe: API in C# Pin
Calla17-Sep-09 1:11
Calla17-Sep-09 1:11 
AnswerRe: API in C# Pin
Arun Jacob17-Sep-09 1:21
Arun Jacob17-Sep-09 1:21 
AnswerRe: API in C# Pin
Harvey Saayman17-Sep-09 1:52
Harvey Saayman17-Sep-09 1:52 
QuestionOmitting HTML footer ? Pin
Mohammad Dayyan17-Sep-09 0:47
Mohammad Dayyan17-Sep-09 0:47 
AnswerRe: Omitting HTML footer ? Pin
Not Active17-Sep-09 1:45
mentorNot Active17-Sep-09 1:45 
GeneralRe: Omitting HTML footer ? Pin
Mohammad Dayyan17-Sep-09 2:12
Mohammad Dayyan17-Sep-09 2:12 
GeneralRe: Omitting HTML footer ? Pin
Not Active17-Sep-09 2:34
mentorNot Active17-Sep-09 2:34 
QuestionTCP Socket issue Pin
Harvey Saayman17-Sep-09 0:43
Harvey Saayman17-Sep-09 0:43 
Hey guys

I'm having some troubles communicating to an external device over the network.

Here's my code

TcpClient BadgerConnection = new TcpClient();
BadgerConnection.Connect(IPAddress.Parse("10.0.0.100"), 1111);

if (BadgerConnection.Connected)
{
    StreamWriter sw = new StreamWriter(BadgerConnection.GetStream());
    sw.AutoFlush = true;

    char[] Buffer = new char[]
    {
        (char)161, // Start Packet
        (char)15,  // Terminal ID
        (char)89,  // Command
        (char)1,   // Amount of arguments to follow
        (char)89,  // Arg 1
        (char)3,   // End Packet
        (char)102  // Checksum = Sum of all chars mod 256
    };

    sw.Write(Buffer);
}


So obviously this isn't working, cause if it did I wouldn't be here Poke tongue | ;-P

What I did was get a packet sniffer and attached it to my program before connecting to the external device.

Here was the result in hex:
C2 A1 0F 59 01 59 03 66

Here's what I intended to send in hex:
A1 0F 59 01 59 03 66


There's an extra character showing up... C2 or rather 194.
Can someone please explain to me why and how can I stop it from sending the extra character?

Thanks

Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL

you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111

AnswerRe: TCP Socket issue Pin
harold aptroot17-Sep-09 3:17
harold aptroot17-Sep-09 3:17 
GeneralRe: TCP Socket issue Pin
Harvey Saayman17-Sep-09 3:26
Harvey Saayman17-Sep-09 3:26 
GeneralRe: TCP Socket issue Pin
harold aptroot17-Sep-09 3:30
harold aptroot17-Sep-09 3:30 
GeneralRe: TCP Socket issue Pin
Harvey Saayman17-Sep-09 5:04
Harvey Saayman17-Sep-09 5:04 
GeneralRe: TCP Socket issue Pin
harold aptroot17-Sep-09 5:35
harold aptroot17-Sep-09 5:35 
GeneralRe: TCP Socket issue Pin
Harvey Saayman17-Sep-09 5:38
Harvey Saayman17-Sep-09 5:38 
GeneralRe: TCP Socket issue Pin
harold aptroot17-Sep-09 5:40
harold aptroot17-Sep-09 5:40 
QuestionLinking to a method using Hyperlinks Pin
Etienne_12317-Sep-09 0:33
Etienne_12317-Sep-09 0:33 
AnswerRe: Linking to a method using Hyperlinks Pin
Keith Barrow17-Sep-09 0:38
professionalKeith Barrow17-Sep-09 0:38 
AnswerRe: Linking to a method using Hyperlinks Pin
musefan17-Sep-09 0:45
musefan17-Sep-09 0:45 
Questionobj\release file Pin
Erdinc2717-Sep-09 0:32
Erdinc2717-Sep-09 0:32 
AnswerRe: obj\release file Pin
Calla17-Sep-09 0:42
Calla17-Sep-09 0:42 
GeneralRe: obj\release file Pin
Erdinc2717-Sep-09 0:58
Erdinc2717-Sep-09 0:58 
GeneralRe: obj\release file Pin
Richard MacCutchan17-Sep-09 5:35
mveRichard MacCutchan17-Sep-09 5:35 
QuestionDataObject Modelling & Relational Presentation Pin
izakfick17-Sep-09 0:27
izakfick17-Sep-09 0:27 
QuestionRetrive rael hard disk serial number no volume Pin
meisamkhajezadeh17-Sep-09 0:20
meisamkhajezadeh17-Sep-09 0:20 
QuestionEmail verification not validation Pin
khosnur16-Sep-09 23:55
khosnur16-Sep-09 23:55 

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.