|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How the devil do I get screen resolutions??!!?ARGH! I have a c#.net web application. I need to retrieve screen height
and width into a variable. I know this is incredibly stupid but HOW THE HECK DO I DO IT??!?!?! A copy to rick1r***@gmail.com would be much appreciate also. Thanks in advance. Hello ManwSloHand,
What kind of resolution, there are several one :) See SystemInformation.PrimaryMonitorSize SystemInformation.WorkingArea SystemInformation.VirtualScreen Screen.PrimaryScreen.Bounds Screen.PrimaryScreen.WorkingArea M> ARGH! I have a c#.net web application. I need to retrieve screen M> height and width into a variable. I know this is incredibly stupid M> but HOW THE HECK DO I DO IT??!?!?! M> M> A copy to rick1r***@gmail.com would be much appreciate also. M> M> Thanks in advance. M> --- WBR, Michael Nemtsev :: blog: http://spaces.msn.com/laflour "At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche >> ARGH! I have a c#.net web application. I need to retrieve screen I doubt any of that is what he wants since that would get the resolution of >> height and width into a variable. I know this is incredibly stupid >> but HOW THE HECK DO I DO IT??!?!?! > > What kind of resolution, there are several one :) > > See > > SystemInformation.PrimaryMonitorSize > SystemInformation.WorkingArea > SystemInformation.VirtualScreen > Screen.PrimaryScreen.Bounds > Screen.PrimaryScreen.WorkingArea the server you are running on and I would expect he wants the cleint resolution (note he did say web application). This would need to be done in client side script that populates variables that would then be posted back to the server for reading. The values to query in javascript would be window.screen.width and window.screen.height. -- Tom Porterfield Maybe we would see he is talking about web application if he wasn't
screaming all around the relevant text... Show quoteHide quote "Tom Porterfield" <tppor***@mvps.org> wrote in message news:uzt30s6QGHA.4952@TK2MSFTNGP09.phx.gbl... >>> ARGH! I have a c#.net web application. I need to retrieve screen >>> height and width into a variable. I know this is incredibly stupid >>> but HOW THE HECK DO I DO IT??!?!?! >> >> What kind of resolution, there are several one :) >> >> See >> >> SystemInformation.PrimaryMonitorSize >> SystemInformation.WorkingArea >> SystemInformation.VirtualScreen >> Screen.PrimaryScreen.Bounds >> Screen.PrimaryScreen.WorkingArea > > I doubt any of that is what he wants since that would get the resolution > of the server you are running on and I would expect he wants the cleint > resolution (note he did say web application). This would need to be done > in client side script that populates variables that would then be posted > back to the server for reading. The values to query in javascript would > be window.screen.width and window.screen.height. > -- > Tom Porterfield Hello Tom,
Sure, my fault, missed web content there is a sample for ASP.net >>> ARGH! I have a c#.net web application. I need to retrieve screen TP> I doubt any of that is what he wants since that would get the>>> height and width into a variable. I know this is incredibly stupid >>> but HOW THE HECK DO I DO IT??!?!?! >>> >> What kind of resolution, there are several one :) >> >> See >> >> SystemInformation.PrimaryMonitorSize >> SystemInformation.WorkingArea >> SystemInformation.VirtualScreen >> Screen.PrimaryScreen.Bounds >> Screen.PrimaryScreen.WorkingArea TP> resolution of the server you are running on and I would expect he TP> wants the cleint resolution (note he did say web application). This TP> would need to be done in client side script that populates variables TP> that would then be posted back to the server for reading. The TP> values to query in javascript would be window.screen.width and TP> window.screen.height. TP> --- WBR, Michael Nemtsev :: blog: http://spaces.msn.com/laflour "At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche There is class named Screen which may help you.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsscreenmemberstopic.asp Calm down a little bit, man Show quoteHide quote "ManwSloHand" <manwsloh***@yahoo.com> wrote in message news:1141929523.438768.121150@i39g2000cwa.googlegroups.com... > ARGH! I have a c#.net web application. I need to retrieve screen height > and width into a variable. I know this is incredibly stupid but HOW THE > HECK DO I DO IT??!?!?! > > A copy to rick1r***@gmail.com would be much appreciate also. > > Thanks in advance. > > There is class named Screen which may help you. Sorry about the yelling guys. This should be simple but I've been> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpre... > Calm down a little bit, man beating my head against a wall for 4 hours now and can't get it to work. I can't find how to get the Screen class included into my project (no using). Also haven't been able to get SystemInformation to work in a web application either. I've done it using Javascript in my ASP apps. Had to have JV write a cookie, then read the cookie from within the ASP script. That might work (I guess) here but just seems like .Net should've dealt with a well-known problem like this. Any more suggestions? you can use javascripts screen.width and screen.height and pass the values
to your app http://www.devcity.net/Articles/64/1/screenresolution.aspx or http://www.quepublishing.com/articles/article.asp?p=28493&seqNum=6&rl=1 both provide good examples -- Show quoteHide quoteRegards John Timney Microsoft MVP "ManwSloHand" <manwsloh***@yahoo.com> wrote in message news:1141929523.438768.121150@i39g2000cwa.googlegroups.com... > ARGH! I have a c#.net web application. I need to retrieve screen height > and width into a variable. I know this is incredibly stupid but HOW THE > HECK DO I DO IT??!?!?! > > A copy to rick1r***@gmail.com would be much appreciate also. > > Thanks in advance. > I noticed both of the previous replies were for windows forms and you are
asking for web application so try this http://www.devcity.net/Articles/64/1/screenresolution.aspx HTH JR Show quoteHide quote "ManwSloHand" <manwsloh***@yahoo.com> wrote in message news:1141929523.438768.121150@i39g2000cwa.googlegroups.com... > ARGH! I have a c#.net web application. I need to retrieve screen height > and width into a variable. I know this is incredibly stupid but HOW THE > HECK DO I DO IT??!?!?! > > A copy to rick1r***@gmail.com would be much appreciate also. > > Thanks in advance. > > I noticed both of the previous replies were for windows forms and you are That's what I'm afraid of. I've been pounding a co-worker of mine with> asking for web application so try this how great .Net tools are and how un-stable Javascript is. Now I've gotta eat crow and go back and say "hey, let's use javascript!". Ugh. Is there a way to use javascript in my page behind code (html) to stick the resolution into a form control (label or textbox)? I'm thinking I could grab it in code. BTW, what I'm ultimately after is that I want to store a database record to record the user's screen res, browser type, and IP for later analysis. Thanks again. On 9 Mar 2006 13:57:24 -0800, ManwSloHand wrote:
> That's what I'm afraid of. I've been pounding a co-worker of mine with But client side you are still in a browser, so you are limited to what you> how great .Net tools are and how un-stable Javascript is. Now I've > gotta eat crow and go back and say "hey, let's use javascript!". can do within a browser window. Now I suppose you could write a custom browser control in .NET, embed that in your web page and then use the .NET code to get the information. This would require the .NET framework be installed on any client visiting your website. Seems like a bad way to go when you can get the same info with a couple of lines of javascript. The key is knowing the appropriate tool to use for each given situation. -- Tom Porterfield
Other interesting topics
Having trouble with multiple threads and a shared resource
Forevery() writable iterator mechanism in C# 3 are all subclasses virtual (use vtables?) Trace debug for every method in code Another form question Reads XML node from App.Config and populates a Class Using properties from a nested class Debugging a command line c# windows Application How to determine if a string in an array Type Question |
|||||||||||||||||||||||