Click here to Skip to main content
15,917,568 members
Home / Discussions / C#
   

C#

 
GeneralRe: Progress Bar Pin
David Stone29-Aug-03 20:11
sitebuilderDavid Stone29-Aug-03 20:11 
QuestionInstance of struct = Object? Pin
Alvaro Mendez29-Aug-03 9:07
Alvaro Mendez29-Aug-03 9:07 
AnswerRe: Instance of struct = Object? Pin
David Stone29-Aug-03 10:27
sitebuilderDavid Stone29-Aug-03 10:27 
GeneralRe: Instance of struct = Object? Pin
Alvaro Mendez29-Aug-03 10:39
Alvaro Mendez29-Aug-03 10:39 
GeneralRe: Instance of struct = Object? Pin
David Stone29-Aug-03 11:41
sitebuilderDavid Stone29-Aug-03 11:41 
Generalipaddress.any Pin
MeisterBiber29-Aug-03 8:49
MeisterBiber29-Aug-03 8:49 
GeneralEnd an invoke early Pin
Ista29-Aug-03 8:30
Ista29-Aug-03 8:30 
General"memory stream is not expandable" Pin
devvvy29-Aug-03 7:32
devvvy29-Aug-03 7:32 
I've trouble getting this work, not sure why. Trying to write encrypted to a memory stream. Exception was thrown with everycall to MemoryStream.Close(): "System.NotSupportedException. Memory Stream is not expandable"


code looks like this:

ASCIIEncoding AE = new ASCIIEncoding ();
byte[] buffer = new byte [10];

buffer = ASCIIEncoding.GetBytes("ABCDE");

byte[] Key = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16};
byte[] IV = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16};

TcpClient TCP = new TcpClient("localhost",11000);
NetworkStream NetStream = TCP.GetStream();
RijndaelManaged RMCrypto = new RijndaelManaged();

MemoryStream mstream2 = new MemoryStream(buffer, 5, 5, true, true);
CryptoStream cstream2 = new CryptoStream(
mstream2,
RMCrypto.CreateEncryptor(Key, IV),
CryptoStreamMode.Write);

StreamWriter cswriter = new StreamWriter(cstream2);
cswriter.Write(AE.GetBytes("AA"));
cswriter.Flush();
cswriter.Close(); <---- EXCEPTION HERE! "memory stream is not expandable"???

Help! What happenned here?

norm
GeneralRe: &quot;memory stream is not expandable&quot; Pin
Daniel Turini29-Aug-03 7:52
Daniel Turini29-Aug-03 7:52 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
devvvy29-Aug-03 8:19
devvvy29-Aug-03 8:19 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
Daniel Turini29-Aug-03 8:26
Daniel Turini29-Aug-03 8:26 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
MeisterBiber29-Aug-03 8:02
MeisterBiber29-Aug-03 8:02 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
devvvy29-Aug-03 8:23
devvvy29-Aug-03 8:23 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
MeisterBiber29-Aug-03 8:32
MeisterBiber29-Aug-03 8:32 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
devvvy29-Aug-03 14:22
devvvy29-Aug-03 14:22 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
Daniel Turini29-Aug-03 8:33
Daniel Turini29-Aug-03 8:33 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
devvvy29-Aug-03 14:16
devvvy29-Aug-03 14:16 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
David Stone29-Aug-03 10:19
sitebuilderDavid Stone29-Aug-03 10:19 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
devvvy29-Aug-03 14:02
devvvy29-Aug-03 14:02 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
David Stone29-Aug-03 17:20
sitebuilderDavid Stone29-Aug-03 17:20 
GeneralRe: &quot;memory stream is not expandable&quot; Pin
devvvy29-Aug-03 17:55
devvvy29-Aug-03 17:55 
GeneralC# and Outlook... Pin
theJazzyBrain29-Aug-03 6:24
theJazzyBrain29-Aug-03 6:24 
GeneralRe: C# and Outlook... Pin
apferreira29-Aug-03 6:52
apferreira29-Aug-03 6:52 
QuestionHow do I Prevent addition to collections returned by properties Pin
Rahul Singh29-Aug-03 6:21
Rahul Singh29-Aug-03 6:21 
AnswerRe: How do I Prevent addition to collections returned by properties Pin
Frank Olorin Rizzi29-Aug-03 7:34
Frank Olorin Rizzi29-Aug-03 7:34 

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.