Click here to Skip to main content
15,913,234 members
Home / Discussions / C#
   

C#

 
AnswerRe: Is there a difference? Pin
Meysam Mahfouzi2-Mar-04 17:55
Meysam Mahfouzi2-Mar-04 17:55 
GeneralRe: Is there a difference? Pin
sps-itsec463-Mar-04 8:48
sps-itsec463-Mar-04 8:48 
GeneralRe: Is there a difference? Pin
Meysam Mahfouzi3-Mar-04 17:27
Meysam Mahfouzi3-Mar-04 17:27 
GeneralHELP with Code Access Security! Pin
Throckmorton2-Mar-04 11:10
Throckmorton2-Mar-04 11:10 
GeneralRe: HELP with Code Access Security! Pin
Heath Stewart2-Mar-04 12:19
protectorHeath Stewart2-Mar-04 12:19 
GeneralRe: HELP with Code Access Security! Pin
Throckmorton2-Mar-04 13:58
Throckmorton2-Mar-04 13:58 
GeneralRe: HELP with Code Access Security! Pin
Throckmorton2-Mar-04 17:23
Throckmorton2-Mar-04 17:23 
GeneralRe: HELP with Code Access Security! Pin
Heath Stewart3-Mar-04 3:27
protectorHeath Stewart3-Mar-04 3:27 
GeneralRe: HELP with Code Access Security! Pin
Throckmorton3-Mar-04 9:19
Throckmorton3-Mar-04 9:19 
GeneralRe: HELP with Code Access Security! Pin
Heath Stewart3-Mar-04 9:27
protectorHeath Stewart3-Mar-04 9:27 
GeneralRe: HELP with Code Access Security! Pin
Throckmorton3-Mar-04 10:11
Throckmorton3-Mar-04 10:11 
GeneralRe: HELP with Code Access Security! Pin
Heath Stewart3-Mar-04 10:16
protectorHeath Stewart3-Mar-04 10:16 
Generalproblems in running app at win startup Pin
visiontec2-Mar-04 10:22
visiontec2-Mar-04 10:22 
Hi there

I am having problems with loading my app at windows startup.

When i load my app by clicking on it, it works fine
but when i load it on windows startup, by adding a registry key in
HKLM\Software\Current Machine\Microsoft\Windows\Current Version\Run
it gives errors, the errors are of my files that i load when my app starts.

i have an xml file that i load when my app starts
that xml file has the location of my database file.

for now i store my db file where my app's executable is.

The code for my class :

using System;
using System.Xml;
using System.Xml.XPath;

namespace Scheduler
{
   public class SettingsXml
   {
      XmlDocument doc = new XmlDocument();

      public SettingsXml()
      {
         doc.Load("scheduler.xml"); // this means that this file
                                    // is where the app's .exe is
      }

      public string DBPath()
      {
         string xstr = "/Scheduler/Configurations/DbPath";
         XmlNode xnode = doc.SelectSingleNode(xstr);
         return xnode.InnerText;
      }
   }
}


when the app loads at win startup it looks for my "scheduler.xml" file
in "c:\scheduler.xml" rather then the place i have told it to!

I fixed the "scheduler.xml" file's location problem by doing this:

doc.Load(System.Windows.Forms.Application.StartupPath + "/scheduler.xml");


It worked.
But still in my xml file the path of my db file is "scheduler.mdb"
now what do i do for this?

cause when i distribute my app it has to have some default place to place my db file.

What is the problem here?

VisionTec
GeneralRe: problems in running app at win startup Pin
Dave Kreskowiak2-Mar-04 11:12
mveDave Kreskowiak2-Mar-04 11:12 
GeneralClient size of an control ... Pin
Andres Coder2-Mar-04 7:49
Andres Coder2-Mar-04 7:49 
GeneralRe: Client size of an control ... Pin
Heath Stewart2-Mar-04 9:24
protectorHeath Stewart2-Mar-04 9:24 
Generalinternet explorer Pin
cmarmr2-Mar-04 7:27
cmarmr2-Mar-04 7:27 
GeneralRe: internet explorer Pin
Heath Stewart2-Mar-04 9:39
protectorHeath Stewart2-Mar-04 9:39 
GeneralRe: internet explorer Pin
cmarmr2-Mar-04 9:55
cmarmr2-Mar-04 9:55 
GeneralRe: internet explorer Pin
Heath Stewart2-Mar-04 10:00
protectorHeath Stewart2-Mar-04 10:00 
GeneralRemoting: sharing an object Pin
Judah Gabriel Himango2-Mar-04 7:24
sponsorJudah Gabriel Himango2-Mar-04 7:24 
GeneralRe: Remoting: sharing an object Pin
Heath Stewart2-Mar-04 9:21
protectorHeath Stewart2-Mar-04 9:21 
QuestionHow To: Wizard for my Application Pin
Ritesh Sompura2-Mar-04 7:01
Ritesh Sompura2-Mar-04 7:01 
AnswerRe: How To: Wizard for my Application Pin
Heath Stewart2-Mar-04 9:16
protectorHeath Stewart2-Mar-04 9:16 
AnswerRe: How To: Wizard for my Application Pin
Nick Parker2-Mar-04 9:27
protectorNick Parker2-Mar-04 9:27 

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.