New Pocket PC?
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.
About Newsletter
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.
With Yukon on the horizon, I'm thinking about the "unmanaged Yukon equivalent" we have now - Extended Stored Procedures. I've used them in the past for such cleverness as calling out to Ws Services from within SQL Server and calling back to other boxes in an asychronous Observer-Observable pattern to let folks know about Data Changing for cache clearing events.
Now, no doubt Yukon will be much more robust even hosting in-proc componentry via Application Domains or out of proc via an ASP_WP style worker process, but until then, are Extended Stored Procedures (in VB6 and C++) evil? See http://tinyurl.com/4er4 (Google Groups Post)
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.
It's a special feeling you get when you look at your Referrer Log and see that someone found your Blog by searching for "shmuck"
http://www.davidjanes.com/blogosphere/tools/search?frame=l&search=schmuck
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.
Great Whitepaper on SourceForge from the OWASP project on the "Top Ten Most Critical Security Vulnerabilities in Web Apps"
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.
Requirement:
Pre-Load the ASP.NET Application object and dont 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!
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.
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.