Jump to content
  • Advertisement
Sign in to follow this  
dillscon

[.net] System.Evironment

This topic is 4018 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do I use System.Environment? Apparently I dont have the library for it. I've tried to add it as a refrence and I dont seem to have it. I have .net framework 1.1, 2.0 and 3.0.

Share this post


Link to post
Share on other sites
Advertisement
I am assuming this is C# or VB.Net? Do you have the appropriate "using System.Environment" (or equivalent) line at the top of the file?

EDIT: Never mind. It looks like I have no idea what I am talking about, as usual.

[Edited by - Moe on September 25, 2007 11:13:59 PM]

Share this post


Link to post
Share on other sites
I'm using C#.

When I try to use "using System.Environment" It acts like there is no such thing. So I'm guessing I dont have that part of the library? If that is the case how would I get it?

Share this post


Link to post
Share on other sites
you can't do using system.environment as environment is a class not a namespace so you just use directly within code (for example if you want to add a newline to a string you'd do string s= "test" +environment.newline)

environment is part of the base framework so it's included by default unless you messed up a setting somewhere , try what i said & lemme know

Share this post


Link to post
Share on other sites
That works perfect thanks for the help! I was trying to use Environment.OSVersion and my error was that it couldnt convert it to a string, for whatever reason I assumed went crazy and just thought I needed System.Environment or something. When I use the code you used it works fine, or if I just use string OS = Environment.OSVersion.ToString();

Thanks a lot for the help!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!