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

C#

 
GeneralRe: CheckedListBoxes Pin
Robert Rohde18-May-05 0:34
Robert Rohde18-May-05 0:34 
Generaldeleting particular node element from xml file Pin
ksanju100017-May-05 23:11
ksanju100017-May-05 23:11 
GeneralRe: deleting particular node element from xml file Pin
Gavin Jeffrey18-May-05 0:58
Gavin Jeffrey18-May-05 0:58 
Generalserializing an array of strings Pin
Green Fuze17-May-05 22:33
Green Fuze17-May-05 22:33 
GeneralRe: serializing an array of strings Pin
Christian Graus17-May-05 22:48
protectorChristian Graus17-May-05 22:48 
GeneralRe: serializing an array of strings Pin
Green Fuze17-May-05 23:14
Green Fuze17-May-05 23:14 
GeneralRe: serializing an array of strings Pin
jinzhecheng18-May-05 7:23
jinzhecheng18-May-05 7:23 
GeneralRe: serializing an array of strings Pin
Green Fuze19-May-05 3:15
Green Fuze19-May-05 3:15 
okay, thaX! Smile | :)
thats my serializing class:

[code]
[Serializable()]
public class serialize : ISerializable
{
public string[] strText;
public serialize() //default constructor
{
//
}


//Deserialization constructor.
public serialize(SerializationInfo info, StreamingContext ctxt)
{
Form1 main = new Form1();

for(int cnt = 0 ; cnt < main.lbList.ItemHeight ; cnt++)
strText[cnt] = (String)info.GetValue("srlText"+cnt.ToString(), typeof(string[]));
}

//Serialization function.
public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
{
Form1 main = new Form1();

for(int cnt = 0 ; cnt < main.lbList.ItemHeight ; cnt++)
info.AddValue("srlText"+cnt.ToString(), strText[cnt]);
}
}
[/code]

what I'm trying to do is to create a new name and a new line in the strText array for each user.

in form1 I'm calling the serialization like this:
[code]
private void btnEnter_Click(object sender, System.EventArgs e)
{
serialize save = new serialize();
enteritem AddItem = new enteritem();

save.strText[0] = AddItem.txtText.Text; //just to try it out I'm using index 0.

Stream stream = File.Open("text.sav", FileMode.OpenOrCreate);
BinaryFormatter bformatter = new BinaryFormatter();

bformatter.Serialize(stream, save);
stream.Close();
}
[/code]

in this line:
Stream stream = File.Open("text.sav", FileMode.OpenOrCreate);

I'm getting an exception
GeneralRe: serializing an array of strings Pin
jinzhecheng20-May-05 3:11
jinzhecheng20-May-05 3:11 
GeneralRe: serializing an array of strings Pin
Green Fuze20-May-05 6:01
Green Fuze20-May-05 6:01 
Generalcall a java class Pin
Mohammad Daba'an17-May-05 22:00
Mohammad Daba'an17-May-05 22:00 
GeneralRe: call a java class Pin
Christian Graus17-May-05 22:47
protectorChristian Graus17-May-05 22:47 
GeneralRe: call a java class Pin
Mohammad Daba'an18-May-05 3:18
Mohammad Daba'an18-May-05 3:18 
GeneralRe: call a java class Pin
Christian Graus18-May-05 12:45
protectorChristian Graus18-May-05 12:45 
GeneralC# Form and SQL Stored Procedures Pin
Kyaw Soe Khaing17-May-05 21:13
Kyaw Soe Khaing17-May-05 21:13 
GeneralRe: C# Form and SQL Stored Procedures Pin
Colin Angus Mackay17-May-05 22:38
Colin Angus Mackay17-May-05 22:38 
Questionhow to use data adapter in ado.net Pin
Anonymous17-May-05 20:33
Anonymous17-May-05 20:33 
AnswerRe: how to use data adapter in ado.net Pin
Luis Alonso Ramos17-May-05 21:01
Luis Alonso Ramos17-May-05 21:01 
Questionhow do I program Outlook EXPRESS 6 ? Pin
erajsri17-May-05 18:48
erajsri17-May-05 18:48 
AnswerRe: how do I program Outlook EXPRESS 6 ? Pin
Christian Graus17-May-05 19:06
protectorChristian Graus17-May-05 19:06 
GeneralC# type casting or converting Pin
kmm_e17-May-05 18:24
susskmm_e17-May-05 18:24 
GeneralRe: C# type casting or converting Pin
Christian Graus17-May-05 19:04
protectorChristian Graus17-May-05 19:04 
GeneralRe: C# type casting or converting Pin
S. Senthil Kumar17-May-05 19:40
S. Senthil Kumar17-May-05 19:40 
QuestionHow to synchronize client database and server database using C#? Pin
pubududilena17-May-05 18:15
pubududilena17-May-05 18:15 
AnswerRe: How to synchronize client database and server database using C#? Pin
Christian Graus17-May-05 19:05
protectorChristian Graus17-May-05 19:05 

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.