A little bit of googling and I found this, which works pretty well, but it turns out that there is an inbuilt method into the framework: BinaryReader, which has the advantage of using exactly two lines of code, relevant code below:
1 BinaryReader br = new BinaryReader(File.Open(@"c:\searchterms.txt",FileMode.Open));
2
3 byte[] dgram = br.ReadBytes((int)br.BaseStream.Length);
I can now send the dgram array to my server application :)
No comments:
Post a Comment