Click here to Skip to main content
15,891,184 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Pin
Pete O'Hanlon17-May-14 23:50
mvePete O'Hanlon17-May-14 23:50 
QuestionTrace IP Who is using my "Share Folder" from LAN Pin
UL UL ALBAB17-May-14 1:58
UL UL ALBAB17-May-14 1:58 
AnswerRe: Trace IP Who is using my "Share Folder" from LAN Pin
Dave Kreskowiak17-May-14 2:11
mveDave Kreskowiak17-May-14 2:11 
AnswerRe: Trace IP Who is using my "Share Folder" from LAN Pin
Pete O'Hanlon17-May-14 23:52
mvePete O'Hanlon17-May-14 23:52 
QuestionDisposing objects in argument list Pin
Member 1064727016-May-14 8:09
Member 1064727016-May-14 8:09 
AnswerRe: Disposing objects in argument list Pin
Eddy Vluggen16-May-14 8:57
professionalEddy Vluggen16-May-14 8:57 
AnswerRe: Disposing objects in argument list Pin
PIEBALDconsult16-May-14 18:26
mvePIEBALDconsult16-May-14 18:26 
QuestionAdd more detail on creating an XML file Pin
Member 1063699816-May-14 8:09
Member 1063699816-May-14 8:09 
I am able to create a XML file like this:
XML
<?xml version="1.0"?>

-<testsuite>

<Name>testsuite</Name>

<Address>Colony</Address>

<Char>arc</Char>

</testsuite>


With the following code:
C#
// Create a new file in C:\\ dir
XmlTextWriter textWriter = new XmlTextWriter("C:\\XML files\\API_PASS.xml", null);

// Opens the document
textWriter.WriteStartDocument();
            
// Write first element
textWriter.WriteStartElement("testsuite");
 
// Write next element
textWriter.WriteStartElement("Name", "");
textWriter.WriteString("testsuite");
textWriter.WriteEndElement();

// Write one more element
textWriter.WriteStartElement("Address", ""); textWriter.WriteString("Colony");
textWriter.WriteEndElement();

// WriteChars
char[] ch = new char[3];
ch[0] = 'a';
ch[1] = 'r';
ch[2] = 'c';
textWriter.WriteStartElement("Char");
textWriter.WriteChars(ch, 0, ch.Length);
textWriter.WriteEndElement();

// Ends the document.
textWriter.WriteEndDocument();

// close writer
textWriter.Close();

*) But I was required to add some more detail for the first element (keep the last line as it is), for example:
HTML
-<testsuite errors="0">

I tried to add in the:
HTML
textWriter.WriteStartElement("testsuite errors=\"0\");

but it shows nothing in the xml file

Anyone can help?
AnswerRe: Add more detail on creating an XML file Pin
Eddy Vluggen16-May-14 9:00
professionalEddy Vluggen16-May-14 9:00 
AnswerRe: Add more detail on creating an XML file Pin
Senthilkumar C K20-May-14 15:17
Senthilkumar C K20-May-14 15:17 
QuestionWriting to Opened File Pin
RebornProgrammer16-May-14 5:00
RebornProgrammer16-May-14 5:00 
QuestionReach usercontrol's child control's methods Pin
op7516-May-14 4:09
op7516-May-14 4:09 
QuestionRe: Reach usercontrol's child control's methods Pin
Richard MacCutchan16-May-14 6:38
mveRichard MacCutchan16-May-14 6:38 
AnswerRe: Reach usercontrol's child control's methods Pin
OriginalGriff16-May-14 8:03
mveOriginalGriff16-May-14 8:03 
GeneralRe: Reach usercontrol's child control's methods Pin
Richard MacCutchan16-May-14 21:25
mveRichard MacCutchan16-May-14 21:25 
AnswerRe: Reach usercontrol's child control's methods Pin
Emre Ataseven17-May-14 10:55
professionalEmre Ataseven17-May-14 10:55 
AnswerRe: Reach usercontrol's child control's methods Pin
SledgeHammer0117-May-14 11:31
SledgeHammer0117-May-14 11:31 
GeneralRe: Reach usercontrol's child control's methods Pin
op7518-May-14 22:00
op7518-May-14 22:00 
QuestionFail to click on Child windows using API Pin
Member 1063699816-May-14 3:29
Member 1063699816-May-14 3:29 
QuestionRe: Fail to click on Child windows using API Pin
Alan N16-May-14 5:46
Alan N16-May-14 5:46 
AnswerRe: Fail to click on Child windows using API Pin
Member 1063699816-May-14 6:43
Member 1063699816-May-14 6:43 
QuestionRe: Fail to click on Child windows using API Pin
Alan N16-May-14 8:32
Alan N16-May-14 8:32 
AnswerRe: Fail to click on Child windows using API Pin
Member 1063699816-May-14 10:34
Member 1063699816-May-14 10:34 
QuestionRe: Fail to click on Child windows using API Pin
Alan N19-May-14 1:50
Alan N19-May-14 1:50 
AnswerRe: Fail to click on Child windows using API Pin
Member 1063699819-May-14 6:04
Member 1063699819-May-14 6:04 

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.