Click here to Skip to main content
16,007,163 members
Home / Discussions / C#
   

C#

 
GeneralRead text in Word Pin
Amauw Scritz4-May-03 1:12
Amauw Scritz4-May-03 1:12 
GeneralRe: Read text in Word Pin
Member 21279844-May-03 3:29
Member 21279844-May-03 3:29 
GeneralCall Flash Pin
Amauw Scritz3-May-03 21:15
Amauw Scritz3-May-03 21:15 
GeneralRe: Call Flash Pin
Torsten Mauz3-May-03 22:58
Torsten Mauz3-May-03 22:58 
GeneralRe: Call Flash Pin
Amauw Scritz3-May-03 23:46
Amauw Scritz3-May-03 23:46 
GeneralRe: Call Flash Pin
Amauw Scritz3-May-03 23:52
Amauw Scritz3-May-03 23:52 
GeneralRe: Call Flash Pin
Stephane Rodriguez.4-May-03 0:28
Stephane Rodriguez.4-May-03 0:28 
GeneralSmall XML/C# problem... Pin
eggie53-May-03 20:12
eggie53-May-03 20:12 
Ok, so I've got this little C# app that updates my asp.net weblog. I plan on passing it on to other people I know, but then I came across a problem...

The files are outputted to the "entries" folder (name by the year, month, day, hour, minute, but thats irrelivant...) located on my hard drive in... (the location is in bold below). So, my problem was that, what if they wanted to change the location of the entries folder... you know... export the files somewhere else on the hard drive.

string fileName = DateTime.Now.ToString("yyyyMMdd_hhmm") + ".xml";<br />
			XmlTextWriter writer = new XmlTextWriter("<big>C:/inetpub/wwwroot/weblog/entries</big>/"+ fileName, null);


SO, then I put togeather a little options form (options.cs) with a text box to enter the location on the drive, and then you click 'OK' and then it is saved to "options.xml". (see the code below...)

	private void buttonOK_Click(object sender, System.EventArgs e)<br />
		{<br />
		XmlTextWriter writer=new XmlTextWriter("options.xml", null);<br />
			writer.Formatting=Formatting.Indented;<br />
			writer.WriteStartDocument();<br />
			writer.WriteStartElement("Options");<br />
		{<br />
			string entryFile=textBoxEntryFile.Text;<br />
			writer.WriteStartElement("entryFile");<br />
			writer.WriteString(entryFile);<br />
			writer.WriteEndElement();<br />
		}<br />
			writer.WriteEndElement();<br />
			writer.WriteEndDocument();<br />
			writer.Close();<br />
			Form.ActiveForm.Close();<br />
<br />
		}


This is what the options.xml file looks like....


?xml version="1.0"?><br />
<Options><br />
  <entryFile>C:\inetpub\wwwroot\weblog\entrys\</entryFile><br />
</Options>



Now, I need this...

XmlTextWriter writer = new XmlTextWriter("<big>C:/inetpub/wwwroot/weblog/entries</big>/"+ fileName, null);

...instead of saveing it evertime.... unconfigurable.... to "C:/inetpub/wwwroot/weblog/entries", but rather save the entries to what ever file it says in the "options.xml" file.

WHEW!... i hope that made sense... im not familar with the XmlTextReader (assuming that what is to be used...) stuff... thanks for all the help possible.

/\ |_ E X E GG
GeneralRe: Small XML/C# problem... Pin
Torsten Mauz3-May-03 22:41
Torsten Mauz3-May-03 22:41 
GeneralRe: Small XML/C# problem... Pin
eggie54-May-03 8:46
eggie54-May-03 8:46 
QuestionWhat does a Stream reader/writer return? Pin
Snowjim3-May-03 12:59
Snowjim3-May-03 12:59 
AnswerRe: What does a Stream reader/writer return? Pin
leppie3-May-03 23:47
leppie3-May-03 23:47 
AnswerRe: What does a Stream reader/writer return? Pin
Stephane Rodriguez.4-May-03 0:17
Stephane Rodriguez.4-May-03 0:17 
QuestionCustomizable 3rd party Dialog controls? Pin
Markri2-May-03 13:19
Markri2-May-03 13:19 
AnswerRe: Customizable 3rd party Dialog controls? Pin
Stephane Rodriguez.4-May-03 0:46
Stephane Rodriguez.4-May-03 0:46 
QuestionOutlook like managed ListView Control ? Pin
Chris Richner2-May-03 6:25
Chris Richner2-May-03 6:25 
AnswerRe: Outlook like managed ListView Control ? Pin
J. Dunlap2-May-03 7:14
J. Dunlap2-May-03 7:14 
QuestionHow to show derived controls on a form? Pin
Alvaro Mendez2-May-03 6:13
Alvaro Mendez2-May-03 6:13 
AnswerRe: How to show derived controls on a form? Pin
apferreira3-May-03 23:16
apferreira3-May-03 23:16 
GeneralSetting ProductName and other version info Pin
S S Basra2-May-03 4:43
S S Basra2-May-03 4:43 
GeneralRe: Setting ProductName and other version info Pin
Burt Harris4-May-03 16:21
Burt Harris4-May-03 16:21 
Questionany idea what this sudo code would do??? Pin
t_elliff2-May-03 4:15
t_elliff2-May-03 4:15 
AnswerRe: any idea what this sudo code would do??? Pin
leppie2-May-03 7:03
leppie2-May-03 7:03 
AnswerRe: any idea what this sudo code would do??? Pin
Jim Stewart2-May-03 8:47
Jim Stewart2-May-03 8:47 
GeneralNices way ... Stream! Pin
Daniel Strigl2-May-03 4:13
Daniel Strigl2-May-03 4:13 

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.