static method

  • Thread starter csharpula csharp
  • Start date
C

csharpula csharp

Hello,

If I work in a static class in a static method. Is it possible in some
way to use the Settings.Default values of this project?

(For example I have a constant value Settings.Default.FileName which I
can't see in static method).

Thank you
 
M

Morten Wennevik [C# MVP]

csharpula csharp said:
Hello,

If I work in a static class in a static method. Is it possible in some
way to use the Settings.Default values of this project?

(For example I have a constant value Settings.Default.FileName which I
can't see in static method).

Thank you

Hi,

"Default" is a static instance of the Settings class and should be available
to both instance and static classes/methods. Your settings may not be called
"Settings" though or you don't have a using for the setting namespace. If
you add your own settings file you may find it as "Settings1" or similar.
The default namespace is <ProjectNamespace>.Properties, but you may also find
it directly under <ProjectNamespace> if you add a new settings file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top