Click here to Skip to main content
15,918,976 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Sending mails with attachments curiosity Pin
Alsvha29-Jan-06 21:54
Alsvha29-Jan-06 21:54 
QuestionString compressing with System.IO.Compression Pin
MrBean27-Jan-06 1:55
MrBean27-Jan-06 1:55 
AnswerRe: String compressing with System.IO.Compression Pin
Dave Kreskowiak27-Jan-06 4:49
mveDave Kreskowiak27-Jan-06 4:49 
GeneralRe: String compressing with System.IO.Compression Pin
MrBean27-Jan-06 5:28
MrBean27-Jan-06 5:28 
GeneralRe: String compressing with System.IO.Compression Pin
Dave Kreskowiak27-Jan-06 6:37
mveDave Kreskowiak27-Jan-06 6:37 
GeneralRe: String compressing with System.IO.Compression Pin
MrBean27-Jan-06 7:06
MrBean27-Jan-06 7:06 
GeneralRe: String compressing with System.IO.Compression Pin
Dave Kreskowiak27-Jan-06 8:22
mveDave Kreskowiak27-Jan-06 8:22 
GeneralRe: String compressing with System.IO.Compression Pin
MrBean29-Jan-06 21:11
MrBean29-Jan-06 21:11 
Well... can't get it to work Frown | :(

Below is the code that I'm currently "fiddling" with.

The CompressString function has been revised and seems to work correctly now. But the Decompress function method somehow still doesn't work.

ZipStream.Read simply doesn't decompress the data in the memoryStream and returns 0 ??

Public Function CompressString(ByVal strInput As String) As String

    Dim bufIn() As Byte = Encoding.UTF8.GetBytes(strInput)
    Dim bufIn() As Byte = Encoding.UTF8.GetBytes(strInput)

    Dim ms As New MemoryStream()
    Dim ZipStream As New GZipStream(ms, CompressionMode.Compress, False)
    ZipStream.Write(bufIn, 0, bufIn.Length)
    Dim bufOut() As Byte = ms.GetBuffer
    ZipStream.Close()

    Return Convert.ToBase64String(bufOut)

End Function

Public Function DeCompressString(ByVal strInput As String) As String

    Dim bufIn() As Byte = Convert.FromBase64String(strInput)

    Dim ms As New MemoryStream()
    ms.Write(bufIn, 0, bufIn.Length) ' Compressed data
    ms.Position = 0

    Dim ZipStream As New GZipStream(ms, CompressionMode.Decompress)

    Dim bufOut(30000) As Byte ' Predefined buffer-size just for test purposes!!
    Dim nRead As Integer

    nRead = ZipStream.Read(bufOut, 0, bufOut.Length) ' Returns 0 ????

    ZipStream.Close()

    Return Convert.ToString(bufOut) ' never mind this... WIP

End Function

GeneralRe: String compressing with System.IO.Compression Pin
Darell F. Butch Jr.2-Feb-06 2:04
Darell F. Butch Jr.2-Feb-06 2:04 
GeneralRe: String compressing with System.IO.Compression Pin
MrBean6-Feb-06 4:12
MrBean6-Feb-06 4:12 
Questionadding Microsoft common dialog control Pin
raj kumar reddy27-Jan-06 0:04
raj kumar reddy27-Jan-06 0:04 
AnswerRe: adding Microsoft common dialog control Pin
Dave Kreskowiak27-Jan-06 4:40
mveDave Kreskowiak27-Jan-06 4:40 
QuestionPrintPreviewDialog Control Pin
Mo_developer26-Jan-06 22:26
Mo_developer26-Jan-06 22:26 
QuestionParent Control's Callback Priority Pin
IMinusMinus26-Jan-06 14:20
IMinusMinus26-Jan-06 14:20 
Question.NET from a management / architecture view Pin
eyuzwa26-Jan-06 11:05
eyuzwa26-Jan-06 11:05 
Questionimport CSV data into variables Pin
besomuk26-Jan-06 4:40
besomuk26-Jan-06 4:40 
AnswerRe: import CSV data into variables Pin
User 665827-Jan-06 7:50
User 665827-Jan-06 7:50 
GeneralRe: import CSV data into variables Pin
besomuk28-Jan-06 23:40
besomuk28-Jan-06 23:40 
QuestionDelete files when uninstalling application Pin
sebastud26-Jan-06 2:09
sebastud26-Jan-06 2:09 
Question.NET Memory Management Pin
RajeshGuptha26-Jan-06 2:01
RajeshGuptha26-Jan-06 2:01 
AnswerRe: .NET Memory Management Pin
Colin Angus Mackay26-Jan-06 2:23
Colin Angus Mackay26-Jan-06 2:23 
AnswerRe: .NET Memory Management Pin
Dave Kreskowiak26-Jan-06 6:24
mveDave Kreskowiak26-Jan-06 6:24 
QuestionUnmanaged Class Serialization in VC .NET Pin
cxxxc26-Jan-06 1:06
cxxxc26-Jan-06 1:06 
QuestionScheduling Task Pin
azam31625-Jan-06 21:30
azam31625-Jan-06 21:30 
Question.NET & firefox Pin
Emily.r25-Jan-06 6:19
Emily.r25-Jan-06 6:19 

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.