Click here to Skip to main content
15,900,906 members
Home / Discussions / C#
   

C#

 
QuestionDeleting a stream\file content. Pin
NaNg1524112-Jun-06 10:32
NaNg1524112-Jun-06 10:32 
AnswerRe: Deleting a stream\file content. Pin
Nougat H.12-Jun-06 12:08
Nougat H.12-Jun-06 12:08 
GeneralRe: Deleting a stream\file content. Pin
NaNg1524112-Jun-06 21:46
NaNg1524112-Jun-06 21:46 
QuestionDundas Diagram connection problems Pin
Nougat H.12-Jun-06 9:44
Nougat H.12-Jun-06 9:44 
AnswerRe: Dundas Diagram connection problems Pin
Nish Nishant12-Jun-06 10:07
sitebuilderNish Nishant12-Jun-06 10:07 
QuestionSave a file path within an XML document? Pin
Nick H. Lauritsen12-Jun-06 9:23
Nick H. Lauritsen12-Jun-06 9:23 
AnswerRe: Save a file path within an XML document? Pin
Ravi Bhavnani12-Jun-06 9:27
professionalRavi Bhavnani12-Jun-06 9:27 
GeneralRe: Save a file path within an XML document? Pin
Nick H. Lauritsen12-Jun-06 9:34
Nick H. Lauritsen12-Jun-06 9:34 
public class ClassFunctions : FormMain
{
private string strXMLLocation = @"..\..\WallpaperDatabase.xml";

public string fxGetFileName()
{
string strFileName = "";
this.openFileDialog1.Multiselect = false;
this.openFileDialog1.ShowDialog();
if (File.Exists(openFileDialog1.FileName))
{
strFileName = openFileDialog1.FileName;
}

return strFileName;
}

public string fxGetString()
{
string strFileName = "";
this.openFileDialog1.Multiselect = false;
this.openFileDialog1.ShowDialog();
if(File.Exists(openFileDialog1.FileName))
{
strFileName = this.openFileDialog1.FileName.ToString();
}
this.openFileDialog1.Dispose();

return strFileName;
}

public void fxAddPicture()
{
string strFilePath = fxGetFileName();

string insertXML;
XmlDocument xdoc = null;
XmlTextReader xreader = null;
XmlDocumentFragment xdocFrag = null;

try
{
xdoc = new XmlDocument();
xreader = new XmlTextReader(strXMLLocation);
xreader.Read();
xdoc.Load(xreader);
xreader.Close();

insertXML = "<Wallpaper><FileName>" + "test" + "</FileName><FilePath>" + strFilePath + "</FilePath></Wallpaper>";

xdocFrag = xdoc.CreateDocumentFragment();
xdocFrag.InnerXml = insertXML;
xdoc.DocumentElement.AppendChild(xdocFrag);
xdoc.Save(strXMLLocation);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}

Here are the two functions within my class which are supposed to do the job J

//Nick
GeneralRe: Save a file path within an XML document? Pin
Nougat H.12-Jun-06 9:50
Nougat H.12-Jun-06 9:50 
GeneralRe: Save a file path within an XML document? Pin
Nick H. Lauritsen12-Jun-06 11:07
Nick H. Lauritsen12-Jun-06 11:07 
GeneralRe: Save a file path within an XML document? Pin
Nougat H.12-Jun-06 11:31
Nougat H.12-Jun-06 11:31 
GeneralRe: Save a file path within an XML document? Pin
Nick H. Lauritsen12-Jun-06 11:39
Nick H. Lauritsen12-Jun-06 11:39 
QuestionClass objects as Datasources [modified] Pin
Andrew Stampor12-Jun-06 9:19
Andrew Stampor12-Jun-06 9:19 
AnswerRe: Class objects as Datasources Pin
Office Lineman12-Jun-06 10:09
Office Lineman12-Jun-06 10:09 
QuestionCE.net C# Call One App From Another Pin
Handheld Programmer12-Jun-06 8:59
Handheld Programmer12-Jun-06 8:59 
QuestionHow can i do table like this one Pin
mariuszfryta12-Jun-06 8:42
mariuszfryta12-Jun-06 8:42 
AnswerRe: How can i do table like this one Pin
Luis Alonso Ramos12-Jun-06 8:46
Luis Alonso Ramos12-Jun-06 8:46 
JokeRe: How can i do table like this one Pin
Jun Du12-Jun-06 8:46
Jun Du12-Jun-06 8:46 
QuestionForcing Validated event before Click event for a ToolStrip button Pin
Luis Alonso Ramos12-Jun-06 8:31
Luis Alonso Ramos12-Jun-06 8:31 
QuestionProgress Message Box? Pin
ahall@mirapoint.com12-Jun-06 7:33
ahall@mirapoint.com12-Jun-06 7:33 
AnswerRe: Progress Message Box? [modified] Pin
Ed.Poore12-Jun-06 9:08
Ed.Poore12-Jun-06 9:08 
GeneralRe: Progress Message Box? Pin
ahall@mirapoint.com12-Jun-06 11:33
ahall@mirapoint.com12-Jun-06 11:33 
QuestionPassing an instance of the base class to a child class Pin
MrEyes12-Jun-06 6:37
MrEyes12-Jun-06 6:37 
AnswerRe: Passing an instance of the base class to a child class Pin
Dustin Metzgar12-Jun-06 6:49
Dustin Metzgar12-Jun-06 6:49 
AnswerRe: Passing an instance of the base class to a child class Pin
Jun Du12-Jun-06 7:40
Jun Du12-Jun-06 7:40 

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.