Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
H

hakervytas

@hakervytas
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • XML Deserialisation to slow..
    H hakervytas

    Any ideas how to improve deserialisation for binary data when reading from file for DataTable. Becouse I tested deserialisation from binarry file and compared with the same data using MySql Database and got strange results that from Database reads and fills ~2x times faster to DataTable then Deserialise and read from finary file stream. I serealised as binary data of DataTable to file. I tested deserialisation and the same functions for SortedArrayList and similar HashTable arrays works ~6x times faster that reading the same data from Database. May anybody know how to improve deserialisation or are exist any algorithms for DataTables or DataSets a lot faster then I founded method? Here a code example in VB.NET that I use for deserialisation of binary data from file for DataTable:

    Public Shared Function DeserializeByte(ByVal b As Byte()) As Object
        If b Is Nothing Then Return Nothing
        Dim f As Runtime.Serialization.IFormatter
        Dim ms As System.IO.MemoryStream = Nothing
        Dim obj As Object = Nothing
        Try
            f = New Runtime.Serialization.Formatters.Binary.BinaryFormatter()
            ms = New System.IO.MemoryStream(b)
            obj = f.Deserialize(ms)
        Catch ex As Exception
        Finally
            If Not ms Is Nothing Then
                ms.Close()
                ms.Dispose()
            End If
        End Try
        Return obj
    End Function
    

    And here file reading, may nead improve:

    Public Shared Function ReadBytesFromFile(ByVal sFileName As String) As Byte()
        Dim b As Byte() = New Byte() {}
        Dim fs As System.IO.FileStream = Nothing
        Dim iLen As Integer = 0
        Try
            fs = New System.IO.FileStream(sFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)
            iLen = CType(fs.Length, Integer)
            b = New Byte(iLen) {}
            fs.Read(b, 0, iLen)
        Catch ex As Exception
        Finally
            If Not fs Is Nothing Then
                fs.Close()
                fs.Dispose()
            End If
        End Try
        Return b
    End Function
    

    Here translated code for C# users:

    public static object DeserializeByte(byte[] b)
    {
    if (b == null) return null;
    Runtime.Serialization.IFormatter f;
    System.IO.MemoryStream ms = null;
    object obj = null;
    try {
    f = new Runtime.Serialization.Formatters.Binary.BinaryFormatter();
    ms = new System.IO.MemoryStream(b);
    obj = f.Deseriali

    ASP.NET csharp tutorial database mysql

  • how do I refresh a page?
    H hakervytas

    For refresh no nead to write what page, just set location to the same location, for me it works ok on all browsers :) function refreshPage() { window.setTimeout('window.location.href=window.location.href;',300000); }

    ASP.NET question css database tutorial

  • Encryption/Decryption API in C#.NET
    H hakervytas

    It's 2 methods to be more secure password in DataBase: 1) Encript with RSA256 or higher, more examples is on MSDN Primary key store in DB, other key in App. For more secure, protect Application with .NET Reactor from http://www.eziriz.com/[^] This tool not freeware, but cost not to much:) and protecting .NET .exe files Well;) 2) Other method is use only MD5 checksum and compare from DB pass, so encript entered password with MD5 and compare value with DB password what is in MD5.

    C# csharp question database security json
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups