Click here to Skip to main content
15,887,350 members
Home / Discussions / C#
   

C#

 
GeneralRe: Working with multiple threads. Pin
CodingLover22-Feb-09 21:06
CodingLover22-Feb-09 21:06 
QuestionHow to create a new keyword Pin
damichab22-Feb-09 14:52
damichab22-Feb-09 14:52 
AnswerRe: How to create a new keyword Pin
PIEBALDconsult22-Feb-09 15:52
mvePIEBALDconsult22-Feb-09 15:52 
GeneralRe: How to create a new keyword Pin
damichab22-Feb-09 16:43
damichab22-Feb-09 16:43 
GeneralRe: How to create a new keyword Pin
Jon Rista22-Feb-09 18:10
Jon Rista22-Feb-09 18:10 
AnswerRe: How to create a new keyword Pin
damichab23-Feb-09 11:09
damichab23-Feb-09 11:09 
Questioncustomize deserialization sample in C#? Pin
George_George22-Feb-09 14:48
George_George22-Feb-09 14:48 
AnswerRe: customize deserialization sample in C#? Pin
Zap-Man22-Feb-09 15:05
Zap-Man22-Feb-09 15:05 
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Soap;


[Serializable]
class Customer {
public string name;
public long id;
}

class Test{
static void Main(string[] args) {
ArrayList list = new ArrayList();

Customer cust = new Customer();
cust.name = "Charles Darwin";
cust.id = 10;
list.Add(cust);

cust = new Customer();
cust.name = "Isaac Newton";
cust.id = 20;
list.Add(cust);

foreach(Customer x in list){
Console.WriteLine("{0} : {1}", x.name.ToString(), x.id.ToString());
}

Console.WriteLine("Saving Customer list");
FileStream s = new FileStream("cust.txt", FileMode.Create);
SoapFormatter f = new SoapFormatter();
f.Serialize(s, list);
s.Close();

Console.WriteLine("Restoring to New List");
s = new FileStream("cust.txt", FileMode.Open);
ArrayList list2 = (ArrayList)f.Deserialize(s);
s.Close();

foreach(Customer y in list2){
Console.WriteLine(y.name + ":" + y.id);
}

}
}

//You have to reference in using System.Runtime.Serialization.Formatters.Soap;
//just right click on the reference folder and click add. Its under the web tab.

//Let me know if this helps
GeneralRe: customize deserialization sample in C#? Pin
George_George22-Feb-09 15:45
George_George22-Feb-09 15:45 
QuestionMaking the enter(return) key call a Validated event Pin
High0ctane22-Feb-09 12:54
High0ctane22-Feb-09 12:54 
AnswerRe: Making the enter(return) key call a Validated event Pin
Megidolaon23-Feb-09 3:10
Megidolaon23-Feb-09 3:10 
AnswerRe: Making the enter(return) key call a Validated event Pin
Richard Dean14-Apr-09 7:28
Richard Dean14-Apr-09 7:28 
QuestionC# area map Pin
Zap-Man22-Feb-09 12:01
Zap-Man22-Feb-09 12:01 
AnswerRe: C# area map Pin
fly90422-Feb-09 12:13
fly90422-Feb-09 12:13 
GeneralRe: C# area map Pin
Zap-Man22-Feb-09 14:40
Zap-Man22-Feb-09 14:40 
GeneralRe: C# area map Pin
fly90422-Feb-09 15:06
fly90422-Feb-09 15:06 
GeneralRe: C# area map Pin
Zap-Man22-Feb-09 15:18
Zap-Man22-Feb-09 15:18 
GeneralRe: C# area map [modified] Pin
fly90423-Feb-09 0:04
fly90423-Feb-09 0:04 
GeneralRe: C# area map Pin
Zap-Man23-Feb-09 13:41
Zap-Man23-Feb-09 13:41 
QuestionPassable function Pin
Chris Copeland22-Feb-09 10:04
mveChris Copeland22-Feb-09 10:04 
AnswerRe: Passable function Pin
Jon Rista22-Feb-09 10:54
Jon Rista22-Feb-09 10:54 
GeneralRe: Passable function Pin
Chris Copeland22-Feb-09 11:02
mveChris Copeland22-Feb-09 11:02 
GeneralRe: Passable function Pin
Jon Rista22-Feb-09 11:16
Jon Rista22-Feb-09 11:16 
QuestionHow to enable auto scroll in a listbox? Pin
bar300022-Feb-09 9:20
bar300022-Feb-09 9:20 
AnswerRe: How to enable auto scroll in a listbox? Pin
Luis Alonso Ramos22-Feb-09 9:34
Luis Alonso Ramos22-Feb-09 9:34 

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.