Click here to Skip to main content
15,512,747 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to create a many-to-many relationship between users in a table? Pin
Alex Wright 202216-Sep-22 7:55
Alex Wright 202216-Sep-22 7:55 
GeneralRe: How to create a many-to-many relationship between users in a table? Pin
Eddy Vluggen17-Sep-22 0:59
professionalEddy Vluggen17-Sep-22 0:59 
SuggestionRe: How to create a many-to-many relationship between users in a table? Pin
Richard Deeming19-Sep-22 22:16
mveRichard Deeming19-Sep-22 22:16 
QuestionProgram instalator in C#, Visual Studio Pin
Ismael_199912-Sep-22 6:36
Ismael_199912-Sep-22 6:36 
AnswerRe: Program instalator in C#, Visual Studio Pin
Gerry Schmitz12-Sep-22 7:21
mveGerry Schmitz12-Sep-22 7:21 
AnswerRe: Program instalator in C#, Visual Studio Pin
OG MAYOR MRL25-Sep-22 3:48
OG MAYOR MRL25-Sep-22 3:48 
Questionreading memory stream in byte chunks Pin
mjeeves10-Sep-22 9:41
mjeeves10-Sep-22 9:41 
GeneralRe: reading memory stream in byte chunks Pin
harold aptroot10-Sep-22 10:49
harold aptroot10-Sep-22 10:49 
BinaryWriter.Write(string) writes a length-preceded string to the stream, with the length encoded as a variable-length integer (7 bits per block and a continuation bit). So some extra stuff appeared in your stream that you didn't count on.

BinaryWriter.Write(string) is most easily "mirrored" by using BinaryReader.ReadString in the decoder. Of course, you can also handle the length manually, but then you should probably also handle the encoding and write raw bytes to the stream to start with.

This is also wrong: _memoryStream.Read(readChunkSize, 0, 3); reading 3 bytes instead of 4. Why not use BinaryReader, it's simpler and less error prone.

By having written one extra byte per mistake (the extra length byte that BinaryWriter.Write(string) wrote, could have been more bytes for longer strings) and by having read one byte too few, a two byte discrepancy was created. Actually you should find that there are two unprintable characters at the start of your string, since it still should be 12 bytes, just not quite the right 12 bytes.
GeneralRe: reading memory stream in byte chunks Pin
mjeeves10-Sep-22 11:04
mjeeves10-Sep-22 11:04 
GeneralRe: reading memory stream in byte chunks Pin
harold aptroot10-Sep-22 11:15
harold aptroot10-Sep-22 11:15 
QuestionC# Service: Error 1053: The service did not respond to the start or control request in a timely fashion Pin
temuco8-Sep-22 21:41
professionaltemuco8-Sep-22 21:41 
AnswerRe: C# Service: Error 1053: The service did not respond to the start or control request in a timely fashion Pin
Richard Deeming8-Sep-22 22:49
mveRichard Deeming8-Sep-22 22:49 
GeneralRe: C# Service: Error 1053: The service did not respond to the start or control request in a timely fashion Pin
temuco8-Sep-22 23:34
professionaltemuco8-Sep-22 23:34 
General[Solved] Re: C# Service: Error 1053: The service did not respond to the start or control request in a timely fashion Pin
temuco9-Sep-22 2:38
professionaltemuco9-Sep-22 2:38 
QuestionC# Battleship gameboard & random assignment Pin
Otto_W5-Sep-22 18:50
Otto_W5-Sep-22 18:50 
AnswerRe: C# Battleship gameboard & random assignment Pin
OriginalGriff5-Sep-22 20:11
mveOriginalGriff5-Sep-22 20:11 
GeneralRe: C# Battleship gameboard & random assignment Pin
Otto_W6-Sep-22 16:51
Otto_W6-Sep-22 16:51 
GeneralRe: C# Battleship gameboard & random assignment Pin
OriginalGriff6-Sep-22 20:19
mveOriginalGriff6-Sep-22 20:19 
GeneralRe: C# Battleship gameboard & random assignment Pin
Otto_W16-Sep-22 22:54
Otto_W16-Sep-22 22:54 
GeneralRe: C# Battleship gameboard & random assignment Pin
OriginalGriff16-Sep-22 23:13
mveOriginalGriff16-Sep-22 23:13 
GeneralRe: C# Battleship gameboard & random assignment Pin
Otto_W24-Sep-22 2:09
Otto_W24-Sep-22 2:09 
GeneralRe: C# Battleship gameboard & random assignment Pin
OriginalGriff24-Sep-22 2:34
mveOriginalGriff24-Sep-22 2:34 
GeneralRe: C# Battleship gameboard & random assignment Pin
Otto_W24-Sep-22 3:45
Otto_W24-Sep-22 3:45 
GeneralRe: C# Battleship gameboard & random assignment Pin
OriginalGriff24-Sep-22 4:16
mveOriginalGriff24-Sep-22 4:16 
GeneralRe: C# Battleship gameboard & random assignment Pin
Otto_W25-Sep-22 22:20
Otto_W25-Sep-22 22:20 

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.