Scott Hanselman

Set the ASP.NET Application Object to Read-Only

January 10, '03 Comments [0] Posted in Web Services | ASP.NET
Sponsored By

Requirement:

Pre-Load the ASP.NET Application object and don¬ít allow other pages in your project to add/modify/delete. Basically, make Application read-only.

Solution:

         private void SetApplicationReadOnlyStatus( bool state ) {
                  Type type = Application.GetType().BaseType;
                  PropertyInfo readPropInfo = type.GetProperty("IsReadOnly",  BindingFlags.NonPublic | BindingFlags.Instance) ;
                  if( readPropInfo != null ) {
                        readPropInfo.SetValue( Application,Convert.ChangeType(state,readPropInfo.PropertyType ) ,null);
                  }
            }
            private void Page_Load(object sender, System.EventArgs e) {
                  Application["MyKey"] = "myValue";
                  // Set application to readonly so that we will not allow any changes.
                  SetApplicationReadOnlyStatus( true );
                  try
                  {
                        // Try setting a value 
                        Application["MyKey"] = "New value";
                        Response.Write("You won't see this");
                  }
                  catch(Exception ex) {
                        // You'll end up here
                        Response.Write(ex.Message);
                }
            }

Thanks to Sairama for the code!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Paul Allens Vulcan MiniPC Here Is Another Interestin

January 10, '03 Comments [0] Posted in
Sponsored By

Paul Allen's Vulcan Mini-PC. Here is another interesting device from CES this week. "A hitherto unknown group within multibillionaire Paul Allen's Vulcan Inc. techno-empire has designed a compact, lightweight, wireless computer that is expected to debut by Christmas for between $1,200 and $1,500." It runs Windows XP. Now this is a device I would want. I have never seen the interest in the OQO. Too big to be a PDA, to small to be a work machine. The Vulcan though is the ultimate mini-PC.

Specs include:

  • 5.8-inch screen at 800X400
  • 20GB drive
  • Support for external keyboard and mouse
  • Batteries last for up to four hours
  • USB 2 port with external CD-ROM
  • WiFi or one of two cellular technologies integrated at the choice of the OEM.

[Pocket PC Thoughts]

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Apple says No to Mozilla

January 8, '03 Comments [1] Posted in Web Services
Sponsored By

Slavo wrote in to let me know that Apple's Safari is built on KHTML and KJS and NOT the Mozilla code base.

Here are some sources: http://tinyurl.com/48gm and http://tinyurl.com/48gn

So, it seems that Safari is built on KDE/Qt's Konqueror web browser rather than Gecko!

Very interesting information, indeed.  I guess my initial thoughts about the new minimalist movement in browsing may be correct - now that everyone's browser is a minimalist (and standard's complient) one, we can't assume that choices for the underlying engine is only IE or Gecko.

One thing I think all this does tell me though, is that there is no reason a browser has to be bloat-ware.  I was talking with Scott from 3Leaf  (He's "Adopter" of Early and Adopter) and he's started running Phoenix.  He revelled in the fact that there's no setup involved.  No shell script, no wise, no installshield, no MSI.  Just run phoenix.exe and it RUNS.  Amazing.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Is Safari just Phoenix? I mean, really, Home, Forward, Back, Google. How hard is that?

January 7, '03 Comments [0] Posted in Musings
Sponsored By

Maybe this is obvious, or maybe I'm insane, but it seems to me (from the outside)  that Apple's new Safari WebBrowser is just a Apple-Branded version of the Mozilla Project's Phoenix Browser.  The position of the built-in Google text box next to the address bar is what tipped me off.  Maybe I'm wrong.

I've been a IE user (who isn't?) forever, although I've made half-assed attempts to switch as I saw something better come out.  I tried Netscape 6, Mozilla at various phases, all the early Gecko-based stuff.  I even went through my whole "Opera" phase back when it still fit on a floppy. 

But, I'm using Phoenix full time now on Windows XP Pro.  I even make the scary "default browser" final step.  IE doesn't even show up on my desktop.  It's an odd feeling.

Also interesting to me is that we spent the better part of ten years putting bells and whistles (and menus and buttons and hot keys) into Browsers, and now we are stripping them out. 

I mean, really, Home, Forward, Back, Google. How hard is that?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Active Directory Application Mode

January 7, '03 Comments [0] Posted in Web Services
Sponsored By

Am I missing something?  Where in my Windows .NET Server 2003 RC2 install is Active Directory Application Mode (AD/AM)?  Certainly not in the AD Wizards...or the help...or the CD? Anyone?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.