Tags » .NET


Hey Hey,

Let’s begin with my first blog post! It took a lot of time – a lot of courage to write it – hell, even more, to publish!! 179 more words


Complete Guide Book to National Eligibility Test, CaLL 09999318556

Global Teachers Academy Ph. O7838024365


Welcome to


This is complete guide book to

National Eligibility Test (NET) Examination of

University Grants Commission (UGC) 708 more words

Asp.net MVC job in Ahmedabad

Greetings from Samyak Infotech Pvt.Ltd.

We have urgent opening for the post of ASP.NET- MVC Developer having Experience between 1 to 4 Year.
Technical Skill Requirement : 49 more words

IT Job

Simple P/Invoke Example

P/Invoke (Platform Invoke) giving C# Arnold Sized Muscles.  This very simple example shows how to call the GetComputerNameEx() Function from the Win32API (kernel32.dll).

A quick search tells me that on a Windows based machine the MAX_COMPUTERNAME_LENGTH is 15 and one extra space is required for the terminator.   104 more words


Read file to Memory using MemoryStream

This example reads in a file using the FileStream class and then stores it in memory using a MemoryStream class.  Once the data is stored in memory it is looped through and displayed to the screen. 71 more words


File Decompression using GZipStream

This example reads in GZipStream compressed file byte by byte and Decompresses it using the GZipStream class.  The data is then outputted to a new file. 75 more words


File Compression using GZipStream

This example reads in a file byte by byte and compresses is using the GZipStream class and then outputs it to a new file.

using System;
using System.IO;
using System.IO.Compression;
class Program
    static void Main(string[] args)
        FileStream fs = new FileStream(@"C:\file.txt", FileMode.Open);
        FileStream fsOut = new FileStream(@"C:\file.zip", FileMode.Create);
        GZipStream gZipToSmall = new GZipStream(fsOut, CompressionLevel.Optimal);
        int buf = 0;
        while (buf != -1)
            buf = fs.ReadByte();
        gZipToSmall.Flush();    //just to make sure all that data is flushed out of the stream