Click here to Skip to main content
15,892,298 members
Home / Discussions / C#
   

C#

 
GeneralRe: I need to get mouse events anywhere on the screen Pin
Li-kai Liu (Angus)30-Sep-02 15:14
Li-kai Liu (Angus)30-Sep-02 15:14 
GeneralRe: I need to get mouse events anywhere on the screen Pin
Anonymous30-Sep-02 15:49
Anonymous30-Sep-02 15:49 
GeneralRe: I need to get mouse events anywhere on the screen Pin
Rüpel1-Oct-02 0:37
Rüpel1-Oct-02 0:37 
GeneralScrolling with the mouse wheel Pin
Nnamdi Onyeyiri29-Sep-02 5:34
Nnamdi Onyeyiri29-Sep-02 5:34 
GeneralRe: Scrolling with the mouse wheel Pin
James T. Johnson29-Sep-02 6:04
James T. Johnson29-Sep-02 6:04 
GeneralRe: Scrolling with the mouse wheel Pin
Nnamdi Onyeyiri29-Sep-02 6:11
Nnamdi Onyeyiri29-Sep-02 6:11 
QuestionHOW to creat FileStream? Pin
imran_rafique28-Sep-02 15:34
imran_rafique28-Sep-02 15:34 
AnswerRe: HOW to creat FileStream? Pin
Stephane Rodriguez.28-Sep-02 21:01
Stephane Rodriguez.28-Sep-02 21:01 
GeneralRe: HOW to creat FileStream? Pin
imran_rafique29-Sep-02 15:55
imran_rafique29-Sep-02 15:55 
GeneralRe: HOW to creat FileStream? Pin
Stephane Rodriguez.29-Sep-02 19:43
Stephane Rodriguez.29-Sep-02 19:43 
Questionmatching types for COM server??? Pin
CherezZaboro28-Sep-02 10:41
CherezZaboro28-Sep-02 10:41 
AnswerRe: matching types for COM server??? Pin
Stephane Rodriguez.28-Sep-02 21:07
Stephane Rodriguez.28-Sep-02 21:07 
GeneralRe: matching types for COM server??? Pin
CherezZaboro30-Sep-02 6:07
CherezZaboro30-Sep-02 6:07 
GeneralRe: matching types for COM server??? Pin
Stephane Rodriguez.30-Sep-02 6:13
Stephane Rodriguez.30-Sep-02 6:13 
QuestionMS-SQL connection (ADO) in C#? Pin
Derek Smigelski28-Sep-02 10:09
Derek Smigelski28-Sep-02 10:09 
AnswerRe: MS-SQL connection (ADO) in C#? Pin
Mazdak28-Sep-02 10:18
Mazdak28-Sep-02 10:18 
GeneralNeed some newbie C# help. Need dock a form to another form. Pin
Derek Smigelski28-Sep-02 9:58
Derek Smigelski28-Sep-02 9:58 
GeneralRe: Need some newbie C# help. Need dock a form to another form. Pin
Gaul28-Sep-02 13:08
Gaul28-Sep-02 13:08 
GeneralRe: Need some newbie C# help. Need dock a form to another form. Pin
Luis Alonso Ramos30-Sep-02 4:16
Luis Alonso Ramos30-Sep-02 4:16 
GeneralControl.Invalidate() Pin
Nnamdi Onyeyiri27-Sep-02 22:52
Nnamdi Onyeyiri27-Sep-02 22:52 
GeneralRe: Control.Invalidate() Pin
James T. Johnson28-Sep-02 5:02
James T. Johnson28-Sep-02 5:02 
Questioncan any body tell the syntex of reading and writing an object into file? Pin
imran_rafique27-Sep-02 16:09
imran_rafique27-Sep-02 16:09 
AnswerRe: can any body tell the syntex of reading and writing an object into file? Pin
Nnamdi Onyeyiri27-Sep-02 22:49
Nnamdi Onyeyiri27-Sep-02 22:49 
GeneralRe: can any body tell the syntex of reading and writing an object into file? Pin
imran_rafique28-Sep-02 15:22
imran_rafique28-Sep-02 15:22 
GeneralRe: can any body tell the syntex of reading and writing an object into file? Pin
Nnamdi Onyeyiri28-Sep-02 22:46
Nnamdi Onyeyiri28-Sep-02 22:46 
im not quite sure what a hash table is, but im sure its held within one object. If you require to store more than one object in the file, simple create a structure that holds all the various types of information, and serialize that.

this is how you use FileStream
using System.IO;
using System.Runtime.Formatters.Binary;
...
public object LoadFile(string filename)
{
   Stream stream = new FileStream(filename, FileMode.Open);
   BinaryFormatter bf = new BinaryFormatter();
   object obj = bf.Deserialize(stream);
   stream.Close();
   return obj;
}

public void SaveFile(string filename, object data)
{
   Stream stream = new FileStream(filename, FileMode.Create);
   BinaryFormatter bf = new BinaryFormatter();
   bf.Serialize(stream, data);
   stream.Close();
}
Simple. Smile | :)


Suspicious | :suss: Email: theeclypse@hotmail.com   URL: http://www.onyeyiri.co.uk
Suspicious | :suss: "All programmers are playwrights and all computers are lousy actors."


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.