h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

LinqConnect Express

Introduction:
  •   LinqConnect Express is a free fast and easy to use ORM solution, developed closely to the Microsoft    LINQ to SQL technology, and supporting SQL Server, Oracle, MySQL, PostgreSQL, and SQLite.
  •       It provides a powerful model designer tool with complete integration to Visual Studio - Entity Developer.

Note that this free package does not allow customization of code templates and is limited to 10 entities in the project

Supports: Visual Studio 2010/2012/2013.

Key Features

  1. Wide database support 
  2. Compatibility 
  3. Fluent mapping support
  4. Professional development team 
  5. Complete toolkit provided
  6. Visual model designer
  7. Performance


Download from Tool

DotConnect for SQLite, Standard Edition

Introduction
 DotConnect for SQLite Standard Edition is a free of charge database connectivity solution built over ADO.NET architecture. It offers basic
functionality for developing database-related applications, web sites.

Supporting Version: Visual Studio 2008/2010/2012/2013.

Product Description:
        It is a free of charge data provider built over ADO.NET architecture and a development framework with number of innovative technologies.
       It offers basic functionality for developing database-related applications and web sites.
       It introduces new approaches for designing applications and boosts productivity of database application development.

Key Features

  1. Direct access to SQLite database
  2. 100% managed code
  3. High performance
  4. Easy to deploy
  5. Supports the latest versions of SQLite database
  6. All SQLite data types support
  7. Operates in both connected and disconnected models
  8. Extra data binding capabilities
  9. Cross-form components cooperation
  10. Free of charge

    DotConnect Express for SQLite supports SQLite engine version 3 and higher.
    The provider works with .NET Framework 2.0, 3.0, 3.5, and 4.0.

Download from Tool

StringCollection Class

Represents a collection of strings.
StringCollection accepts Nothing as a valid value and allows duplicate elements.
String comparisons are case-sensitive.
Elements in this collection can be accessed using an integer index. Indexes in this collection are zero-based.

Syntax:

  Dim sColl As New StringCollection()
  Dim colArr() As String = {"RED", "GREEN", "YELLOW", "BLUE"}
      sColl.AddRange(colArr)

ListDictionary Class

Implements IDictionary using a singly linked list.
Recommended for collections that typically contain 10 items or less.
It is smaller and faster than a Hashtable
This should not be used if performance is important for large numbers of elements.

Members, such as Item, Add, Remove, and Contains are O(n) operations, where n is Count.

Syntax:
For Each direntry As DictionaryEntry In myListDictionary
  ...
Next direntry

PowerModes in Microsoft.Win32


  • Resume The operating system is about to resume from a suspended state.
  • StatusChange A power mode status notification event has been raised by the operating system. This might indicate a weak or charging battery, a transition between AC power and battery, or another change in the status of the system power supply.
  • Suspend The operating system is about to be suspended.


Microsoft.Win32 Namespace

The Microsoft. Win32 namespace provides two types of classes: those that handle events raised by the operating system and those that manipulate the system registry.

SystemEvent Class

Provides access to system event notifications. This class cannot be inherited.


  • DisplaySettingsChanged Event
  • DisplaySettingsChanging Event
  • EventsThreadShutdown Event
  • InstalledFontsChanged Event
  • LowMemory Event
  • PaletteChanged Event
  • PowerModeChanged Event
  • SessionEnded Event
  • SessionEnding Event
  • SessionSwitch Event
  • TimeChanged Event
  • TimerElapsed Event
  • UserPreferenceChanged Event
  • UserPreferenceChanging Event

Expose Keys in Registry

CurrentUser
Stores information about user preferences.
LocalMachine
Stores configuration information for the local machine.
ClassesRoot
Stores information about types (and classes) and their properties.
Users
Stores information about the default user configuration.
PerformanceData
Stores performance information for software components.
CurrentConfig
Stores non-user-specific hardware information.
DynData
Stores dynamic data.

Compress and Decompress in VB.Net

Thanks to MSDN

Namespace

Imports System.IO.Compression

Declare Variable
'Use GZipStream Class for Compress and Decompress Folder
    Dim dirpath As String = "E:\TestCompress"

Private Sub Compress(ByVal fi As FileInfo)

        Using inFile As FileStream = fi.OpenRead()
            If (File.GetAttributes(fi.FullName) And FileAttributes.Hidden) _
                <> FileAttributes.Hidden And fi.Extension <> ".gz" Then
                Using outFile As FileStream = File.Create(fi.FullName + ".gz")
                    Using Compress As GZipStream = New GZipStream(outFile, CompressionMode.Compress)
                        ' Copy the source file into the compression stream.
                        Dim buffer As Byte() = New Byte(4096) {}
                        Dim numRead As Integer
                        numRead = inFile.Read(buffer, 0, buffer.Length)
                        Do While numRead <> 0
                            Compress.Write(buffer, 0, numRead)
                            numRead = inFile.Read(buffer, 0, buffer.Length)
                        Loop
                        Console.WriteLine("Compressed {0} from {1} to {2} bytes.", _
                                          fi.Name, fi.Length.ToString(), outFile.Length.ToString())
                    End Using
                End Using
            End If
        End Using
    End Sub
    Private Sub Decompress(ByVal fi As FileInfo)
        Using inFile As FileStream = fi.OpenRead()
            Dim curFile As String = fi.FullName
            Dim origName = curFile.Remove(curFile.Length - fi.Extension.Length)
            Using outFile As FileStream = File.Create(origName)
                Using Decompress As GZipStream = New GZipStream(inFile, CompressionMode.Decompress)
                    Dim buffer As Byte() = New Byte(4096) {}
                    Dim numRead As Integer
                    numRead = Decompress.Read(buffer, 0, buffer.Length)
                    Do While numRead <> 0
                        outFile.Write(buffer, 0, numRead)
                        numRead = Decompress.Read(buffer, 0, buffer.Length)
                    Loop
                    Console.WriteLine("Decompressed: {0}", fi.Name)
                End Using
            End Using
        End Using
    End Sub

    Private Sub CompressDeCompress(ByVal path As String, ByVal mode As CompressType)
        Dim di As DirectoryInfo = New DirectoryInfo(path)
        Select Case mode
            Case CompressType.Compress
                For Each fi As FileInfo In di.GetFiles()
                    Compress(fi)
                Next
            Case CompressType.Decompress
                For Each fi As FileInfo In di.GetFiles("*.gz")
                    Decompress(fi)
                Next
        End Select
    End Sub

    Enum CompressType
        Compress
        Decompress
    End Enum

 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        CompressDeCompress(dirpath, CompressType.Compress)
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        CompressDeCompress(dirpath, CompressType.Decompress)
    End Sub

ZipFile.Open Method

This method is applicable in .NET FRAMEWORK 4.5
Open a Zip archive at the specified path and on the specified mode

 Dim zipPath As String = "c:\naraayanan\exampleuser\end.zip"
        Dim extractPath As String = "c:\naraayanan\exampleuser\extract"
        Dim newFile As String = "c:\naraayanan\exampleuser\NewFile.txt"

        Using archive As ZipArchive = ZipFile.Open(zipPath, ZipArchiveMode.Update)
            archive.CreateEntryFromFile(newFile, "NewEntry.txt", CompressionLevel.Fastest)
            archive.ExtractToDirectory(extractPath)
        End Using