Click here to Skip to main content
15,922,574 members
Home / Discussions / C#
   

C#

 
GeneralRe: Equivilent of session in windows Pin
leppie29-Jul-02 4:21
leppie29-Jul-02 4:21 
GeneralRe: Equivilent of session in windows Pin
Anonymous30-Jul-02 23:02
Anonymous30-Jul-02 23:02 
QuestionXMLTextWriter ??? Pin
Christian Graus29-Jul-02 2:10
protectorChristian Graus29-Jul-02 2:10 
AnswerRe: XMLTextWriter ??? Pin
Paul Watson29-Jul-02 2:29
sitebuilderPaul Watson29-Jul-02 2:29 
GeneralRe: XMLTextWriter ??? Pin
Christian Graus29-Jul-02 12:20
protectorChristian Graus29-Jul-02 12:20 
GeneralRe: XMLTextWriter ??? Pin
Nick Parker29-Jul-02 17:28
protectorNick Parker29-Jul-02 17:28 
GeneralRe: XMLTextWriter ??? Pin
Paul Watson30-Jul-02 1:10
sitebuilderPaul Watson30-Jul-02 1:10 
AnswerRe: XMLTextWriter ??? Pin
leppie29-Jul-02 4:25
leppie29-Jul-02 4:25 
Hi,

If you look at an article about XmlSerializer submitted end last week, you should get an better idea too. Smile | :)

Here some code i have used:

System.Xml.XmlTextWriter xmlwriter = new XmlTextWriter(filename, System.Text.Encoding.ASCII);
xmlwriter.Formatting = Formatting.Indented;
xmlwriter.WriteStartDocument();

xmlwriter.WriteDocType("Options", null , null, null);

xmlwriter.WriteComment("MYrc Option File. Edit at own risk!");
xmlwriter.WriteStartElement("Options"); //root element

PropertyInfo[] props = this.GetType().GetProperties();

foreach (PropertyInfo prop in props)
{
    xmlwriter.WriteStartElement(prop.Name);
    object da = prop.GetValue(this, null);
    xmlwriter.WriteAttributeString("Type", prop.PropertyType.ToString());
    if (da != null) xmlwriter.WriteAttributeString("Value",da.ToString());
    else xmlwriter.WriteAttributeString("value", "null");

    xmlwriter.WriteEndElement();
}
xmlwriter.WriteEndElement();
xmlwriter.WriteEndDocument();
xmlwriter.Flush();
xmlwriter.Close();


This is for an OptionGrid class in trying to get going, but I have had no success with non primitive types Frown | :( , but it works well with primatives Smile | :)

Hope this helps.

MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc
for more info. Big Grin | :-D
GeneralRe: XMLTextWriter ??? Pin
Christian Graus29-Jul-02 12:22
protectorChristian Graus29-Jul-02 12:22 
GeneralWeb Service Deployment Pin
Li Mu Bai29-Jul-02 1:52
Li Mu Bai29-Jul-02 1:52 
GeneralRe: Web Service Deployment Pin
Feng Qin29-Jul-02 14:35
Feng Qin29-Jul-02 14:35 
GeneralProblem at creating a vs.net wizard Pin
Feng Qin29-Jul-02 1:47
Feng Qin29-Jul-02 1:47 
GeneralInheriting a Windows Form as a User Control Pin
Paul Watson29-Jul-02 1:41
sitebuilderPaul Watson29-Jul-02 1:41 
GeneralRe: Inheriting a Windows Form as a User Control Pin
leppie29-Jul-02 1:57
leppie29-Jul-02 1:57 
GeneralRe: Inheriting a Windows Form as a User Control (Windows Form and User Control basically the same thing) Pin
Paul Watson29-Jul-02 2:21
sitebuilderPaul Watson29-Jul-02 2:21 
GeneralRe: Inheriting a Windows Form as a User Control (Windows Form and User Control basically the same thing) Pin
leppie29-Jul-02 4:09
leppie29-Jul-02 4:09 
GeneralAnakrino Pin
stephen woolhead29-Jul-02 1:05
stephen woolhead29-Jul-02 1:05 
GeneralRe: Anakrino Pin
Andy Smith29-Jul-02 7:07
Andy Smith29-Jul-02 7:07 
GeneralRe: Anakrino Pin
leppie29-Jul-02 8:12
leppie29-Jul-02 8:12 
GeneralRaising events in C# ASP.NET app. Pin
Naresh Karamchetty28-Jul-02 14:24
Naresh Karamchetty28-Jul-02 14:24 
GeneralRe: Raising events in C# ASP.NET app. Pin
Andy Smith28-Jul-02 21:50
Andy Smith28-Jul-02 21:50 
Generaldatabase Pin
Shotgun28-Jul-02 12:40
Shotgun28-Jul-02 12:40 
GeneralRe: database Pin
James T. Johnson28-Jul-02 13:41
James T. Johnson28-Jul-02 13:41 
GeneralSigning an assembly Pin
afronaut28-Jul-02 11:53
afronaut28-Jul-02 11:53 
GeneralRe: Signing an assembly Pin
Nnamdi Onyeyiri28-Jul-02 12:51
Nnamdi Onyeyiri28-Jul-02 12:51 

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.