Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools


Click here to copy the following block
' Deserialize an object from a file in SOAP format.
Function LoadSoapData(ByVal path As String) As Object
  ' Open a file stream for input.
  Dim fs As FileStream = New FileStream(path, FileMode.Open)
  ' Create a SOAP formatter for this stream.
  Dim sf As New SoapFormatter(Nothing, _
    New StreamingContext(StreamingContextStates.File))

  ' Deserialize the contents of the file stream into an object.
  LoadSoapData = sf.Deserialize(fs)
  ' close the stream.
  fs.Close()
End Function


' This sample procedure tests the reusable routine above.
' Note that you also need the SaveSoapData function, linked below.

Sub TestSoapSerialization()
  ' Create a hashtable object and fill it with some data.
  Dim ht As New Hashtable()
  ht.Add("One", 1)
  ht.Add("Two", 2)
  ht.Add("Three", 3)

  ' Save the hash table to disk in SOAP format.
  SaveSoapData("c:\hashtbl.xml", ht)

  ' Reload the file contents into another HashTable object.
  Dim ht2 As Hashtable
  ht2 = CType(LoadSoapData("c:\hashtbl.xml"), Hashtable)

  ' Display values.
  Dim de As DictionaryEntry
  For Each de In ht2
    Console.WriteLine("Key=" & de.Key.ToString & "  Value=" & _
      de.Value.ToString)
  Next
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.