Click here to Skip to main content
16,005,120 members
Home / Discussions / C#
   

C#

 
General3D Graphs in C# Pin
amitmohanty17-Aug-05 19:01
amitmohanty17-Aug-05 19:01 
GeneralTrig: Calculating points on a line Pin
J4amieC17-Aug-05 11:44
J4amieC17-Aug-05 11:44 
GeneralRe: Trig: Calculating points on a line Pin
Christian Graus17-Aug-05 12:11
protectorChristian Graus17-Aug-05 12:11 
GeneralRe: Trig: Calculating points on a line Pin
J4amieC17-Aug-05 22:26
J4amieC17-Aug-05 22:26 
GeneralRe: Trig: Calculating points on a line Pin
Christian Graus18-Aug-05 14:52
protectorChristian Graus18-Aug-05 14:52 
GeneralRe: Trig: Calculating points on a line Pin
J4amieC21-Aug-05 9:53
J4amieC21-Aug-05 9:53 
GeneralSave inside a file ArrayList code Pin
Sasuko17-Aug-05 11:18
Sasuko17-Aug-05 11:18 
GeneralRe: Save inside a file ArrayList code Pin
Guffa17-Aug-05 12:07
Guffa17-Aug-05 12:07 
Add a custom serializer and deserializer to the class, then. Something like:

class myClass{<br />
<br />
  public int value;<br />
  public string name;<br />
<br />
  public MyClass() {}<br />
<br />
  public MyClass(string serializedData) {<br />
    int pos = serializedData.FirstIndexOf(' ');<br />
    this.value = int.Parse(serializedData.Substring(0, pos));<br />
    this.name = serializedData.SubString(pos + 1);<br />
  }<br />
<br />
  public string Serialize() {<br />
    return this.value.ToString() + " " + this.name;<br />
  }<br />
<br />
}


Then just loop through the arrays and write the serialized string of each object to the file (using WriteLine).

When you wish to recreate the arrays, read each line and use the deserializer constructor to recreate each object.

---
b { font-weight: normal; }

GeneralRe: Save inside a file ArrayList code Pin
Sasuko17-Aug-05 12:16
Sasuko17-Aug-05 12:16 
GeneralRe: Save inside a file ArrayList code Pin
Guffa17-Aug-05 21:07
Guffa17-Aug-05 21:07 
GeneralRe: Save inside a file ArrayList code Pin
S. Senthil Kumar17-Aug-05 21:00
S. Senthil Kumar17-Aug-05 21:00 
GeneralRe: Save inside a file ArrayList code Pin
Sasuko17-Aug-05 21:49
Sasuko17-Aug-05 21:49 
GeneralRe: Save inside a file ArrayList code Pin
Azerax20-Aug-05 2:22
Azerax20-Aug-05 2:22 
GeneralMask the TextBox Pin
zaboboa17-Aug-05 10:11
zaboboa17-Aug-05 10:11 
GeneralRe: Mask the TextBox Pin
BammBamm17-Aug-05 10:59
BammBamm17-Aug-05 10:59 
GeneralRe: Mask the TextBox Pin
Mohamad Al Husseiny17-Aug-05 11:44
Mohamad Al Husseiny17-Aug-05 11:44 
GeneralRe: Mask the TextBox Pin
zaboboa18-Aug-05 2:22
zaboboa18-Aug-05 2:22 
GeneralRe: Mask the TextBox Pin
Mohamad Al Husseiny18-Aug-05 3:20
Mohamad Al Husseiny18-Aug-05 3:20 
GeneralRe: Mask the TextBox Pin
zaboboa18-Aug-05 3:36
zaboboa18-Aug-05 3:36 
GeneralRe: Mask the TextBox Pin
Mohamad Al Husseiny18-Aug-05 3:44
Mohamad Al Husseiny18-Aug-05 3:44 
GeneralNNTP sever Pin
Mridang Agarwalla17-Aug-05 9:12
Mridang Agarwalla17-Aug-05 9:12 
GeneralRe: NNTP sever Pin
leppie17-Aug-05 23:40
leppie17-Aug-05 23:40 
Generalremoving XML entries Pin
Mridang Agarwalla17-Aug-05 8:44
Mridang Agarwalla17-Aug-05 8:44 
GeneralRe: removing XML entries Pin
BammBamm17-Aug-05 8:53
BammBamm17-Aug-05 8:53 
GeneralRe: removing XML entries Pin
Mridang Agarwalla17-Aug-05 8:57
Mridang Agarwalla17-Aug-05 8:57 

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.