<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2369916699123161486</id><updated>2024-09-13T11:45:41.997-07:00</updated><category term="Chapter 1"/><category term="Application Deployment And Maintenance"/><category term="Benefits of the .NET Framework"/><category term="Elements of .NET Framework"/><category term="Event Logging"/><category term="Introduction"/><category term="Overview"/><category term="Performance Counters"/><category term="Tracing"/><title type='text'>ASP.Net Bible</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://asp-dot-net-bible.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2369916699123161486/posts/default'/><link rel='alternate' type='text/html' href='http://asp-dot-net-bible.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Bhupesh</name><uri>http://www.blogger.com/profile/14355456892296615865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2369916699123161486.post-3938963904309456534</id><published>2009-03-18T05:13:00.000-07:00</published><updated>2009-03-18T05:22:08.026-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Chapter 1"/><category scheme="http://www.blogger.com/atom/ns#" term="Elements of .NET Framework"/><title type='text'>Elements of the .NET Framework</title><content type='html'>The Main Elements of the .NET Framework&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;The .NET Framework consists of three key elements&lt;/span&gt;&lt;br /&gt;1. Common Language Runtime&lt;br /&gt;2. NET Class Library&lt;br /&gt;3. Unifying components&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcFD513NGKcGIvSsyZj20MHv5Y6CBg3CR9qGbcBfZSdlyD9YpmH7WuzA_VEwYLl3L-M560krdc6EnslYYBVBL8bDoeFwAXngsE4WGg4EX_npvBmE60BihxwEYJnAS7DGuDfcVNkYhta3De/s1600-h/elements+of.net+framework.JPG&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 328px; height: 177px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcFD513NGKcGIvSsyZj20MHv5Y6CBg3CR9qGbcBfZSdlyD9YpmH7WuzA_VEwYLl3L-M560krdc6EnslYYBVBL8bDoeFwAXngsE4WGg4EX_npvBmE60BihxwEYJnAS7DGuDfcVNkYhta3De/s320/elements+of.net+framework.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5314501626656334050&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Common Language Runtime&lt;/span&gt;&lt;br /&gt;The Common Language Runtime (CLR) is a layer between an application and the operating system it executes on. The CLR simplifies an application&#39;s design and reduces the amount of code developers need to write because it provides a variety of execution services that include memory management, thread management, component lifetime management, and default error handling. The key benefit of the CLR is that it transparently provides these execution services to all applications, regardless of what programming language they&#39;re written in and without any additional effort on the part of the developer.&lt;br /&gt;                               The CLR is also responsible for compiling code just before it executes. Instead of producing a binary representation of your code, as traditional compilers do, .NET compilers produce a representation of your code in a language common to the .NET  Framework: Microsoft Intermediate Language (MSIL), often referred to as IL. When your code executes for the first time, the CLR invokes a special compiler called a Just In Time (JIT) compiler, which transforms the IL into executable instructions that are specific to the type and model of your system&#39;s processor. Because all .NET languages have the same compiled representation, they all have similar performance characteristics. This means that a program written in Visual Basic .NET can perform as well as the same program written in Visual C++ .NET. (C++ is the language of choice for developers who need the best possible performance a system can deliver.)&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asp-dot-net-bible.blogspot.com/feeds/3938963904309456534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://asp-dot-net-bible.blogspot.com/2009/03/elements-of-net-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2369916699123161486/posts/default/3938963904309456534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2369916699123161486/posts/default/3938963904309456534'/><link rel='alternate' type='text/html' href='http://asp-dot-net-bible.blogspot.com/2009/03/elements-of-net-framework.html' title='Elements of the .NET Framework'/><author><name>Bhupesh</name><uri>http://www.blogger.com/profile/14355456892296615865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcFD513NGKcGIvSsyZj20MHv5Y6CBg3CR9qGbcBfZSdlyD9YpmH7WuzA_VEwYLl3L-M560krdc6EnslYYBVBL8bDoeFwAXngsE4WGg4EX_npvBmE60BihxwEYJnAS7DGuDfcVNkYhta3De/s72-c/elements+of.net+framework.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2369916699123161486.post-6292069137478187887</id><published>2009-03-18T05:07:00.000-07:00</published><updated>2009-03-18T05:54:34.138-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Application Deployment And Maintenance"/><category scheme="http://www.blogger.com/atom/ns#" term="Chapter 1"/><title type='text'>Easy application deployment and maintenance</title><content type='html'>Applications are often made up of several components:&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;1. Web  Pages&lt;br /&gt;2. Windows forms-based components&lt;br /&gt;3. Web services&lt;br /&gt;4. Components housed in DLLs&lt;br /&gt;The .NET Framework makes it possible to install applications that use some or all of these components without having to register DLLs (using regsvr32.exe) or to create Registration Database (also known as the system Registry) entries. The .NET Framework makes it easy to deploy applications using zero-impact installation often all that&#39;s required to install an application is to copy it into a directory along with the components it requires. This is possible because the .NET Framework handles the details of locating and loading components an application needs, even if you have several versions of the same component available on a single system. All of this is possible because the .NET Framework records extra information about an application&#39;s components — the extra information is called metadata. A component of the .NET, Framework, the Class Loader, inspects an application&#39;s metadata and ensures that all of the components the application depends on are available on the system before the application begins to execute. This feature of the .NET Framework works to isolate applications from each other despite changes in system configuration, making it easier to install and upgrade applications.&lt;br /&gt;                              Once an application is running on a system, it is sometimes necessary to change certain traits of the application, such as its security requirements, optional parameters, and even database connections. .NET Framework applications use a configuration model based on application-configuration files. A configuration file is a text file that contains XML elements that affect the behavior of an application. For example, an administrator can configure an application to use only a certain version of a component the application relies on, thereby ensuring consistent behavior regardless of how often the component is upgraded.&lt;br /&gt;The following code shows an ASP.NET&#39;s basic configuration file; the file is called web.config:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyzwVOcMTNkOJVDx_DRl90ifPaSTZkMaVdRp3OEMZqvDKo4jhsMLXco_aBeCry9-iEQevIEUFqwpXtjWK4CfGDrWEjZRfprGybpHufW0gYHKLeIXUOWQdILXajyh32qGb9I4Pujio2mCDV/s1600-h/code.JPG&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 204px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyzwVOcMTNkOJVDx_DRl90ifPaSTZkMaVdRp3OEMZqvDKo4jhsMLXco_aBeCry9-iEQevIEUFqwpXtjWK4CfGDrWEjZRfprGybpHufW0gYHKLeIXUOWQdILXajyh32qGb9I4Pujio2mCDV/s320/code.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5314509499878964162&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This code shows that the ASP.NET application will have page buffering on (pages will be sent to clients only when the page is completely rendered), and that ASP.NET will track  ndividual clients&#39; session information (as shown in the pages tag). This code also demonstrates how to define a custom configuration key, called dsn — within the appSettings section, which applications have access to through the TraceSwitch class.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asp-dot-net-bible.blogspot.com/feeds/6292069137478187887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://asp-dot-net-bible.blogspot.com/2009/03/easy-application-deployment-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2369916699123161486/posts/default/6292069137478187887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2369916699123161486/posts/default/6292069137478187887'/><link rel='alternate' type='text/html' href='http://asp-dot-net-bible.blogspot.com/2009/03/easy-application-deployment-and.html' title='Easy application deployment and maintenance'/><author><name>Bhupesh</name><uri>http://www.blogger.com/profile/14355456892296615865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyzwVOcMTNkOJVDx_DRl90ifPaSTZkMaVdRp3OEMZqvDKo4jhsMLXco_aBeCry9-iEQevIEUFqwpXtjWK4CfGDrWEjZRfprGybpHufW0gYHKLeIXUOWQdILXajyh32qGb9I4Pujio2mCDV/s72-c/code.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2369916699123161486.post-371746390152133401</id><published>2009-02-10T10:09:00.000-08:00</published><updated>2009-02-10T10:29:02.581-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Chapter 1"/><category scheme="http://www.blogger.com/atom/ns#" term="Event Logging"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance Counters"/><category scheme="http://www.blogger.com/atom/ns#" term="Tracing"/><title type='text'>Three types of Runtime diagnostics:Event logging,Performance counters,Tracing</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Framework provides three types of Runtime diagnostics:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;1. &lt;a href=&quot;http://en.wikipedia.org/wiki/Event_Viewer&quot;&gt;Event logging&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;2. &lt;a href=&quot;http://www.codeproject.com/KB/dotnet/perfcounter.aspx&quot;&gt;Performance counters&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;3. Tracing&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;1. &lt;a href=&quot;http://www.webreference.com/programming/asp/logging/&quot;&gt;Event logging&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;Windows 2000 and &lt;a href=&quot;http://www.microsoft.com/windows/windows-xp/&quot;&gt;Windows XP&lt;/a&gt; have a feature called an Event Log _ a database containing information about important hardware or software events. The &lt;a href=&quot;http://support.microsoft.com/kb/308427&quot;&gt;Event Log&lt;/a&gt; is useful for recording information about the status of your applications and provides systems administrators a means of diagnosing problems, since they can review Event Log entries using the Event Viewer (supplied with Windows and available in theAdministrative Tools group in the Control Panel). There are three types of &lt;a href=&quot;http://en.wikipedia.org/wiki/Event_Viewer&quot;&gt;Event Log&lt;/a&gt; events:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;1.  Informational events:&lt;/span&gt; Usually contain basic information, such as an application starting or shutting down&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;2. Warning events:&lt;/span&gt; Usually provide information about unusual conditions that have the potential to become errors&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;3. Error events:&lt;/span&gt; Represent critical errors in an application that prevent it from executing normally .&lt;br /&gt;Events are stored in &lt;a href=&quot;http://www.eventlogs.com/&quot;&gt;Event Logs&lt;/a&gt; — Windows supports three types of Event Logs:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;1. Application:&lt;/span&gt; Contains messages that applications such as &lt;a href=&quot;http://www.sqlmag.com/Article/ArticleID/94131/sql_server_94131.html&quot;&gt;Microsoft SQL Server log&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;2. System:&lt;/span&gt; Contains messages that device drivers and system services log.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;3. Security:&lt;/span&gt; Contains system-generated messages about events that occur when security auditing is enabled&lt;br /&gt;The .NET Framework makes it easy to work with the Event Log as shown in the following&lt;br /&gt;code:&lt;br /&gt;&lt;br /&gt;Imports System&lt;br /&gt;Imports System.Diagnostics&lt;br /&gt;Module eventLogDemo&lt;br /&gt;Sub Main()&lt;br /&gt;If Not EventLog.SourceExists(&quot;ASPnetBible&quot;) Then&lt;br /&gt;EventLog.CreateEventSource( _&lt;br /&gt;&quot;ASPnetBible&quot;, &quot;Application&quot;)&lt;br /&gt;Console.WriteLine( _&lt;br /&gt;&quot;Created new EventSource &#39;ASPnetBible&#39;&quot;)&lt;br /&gt;End If&lt;br /&gt;Dim evLog As New EventLog()&lt;br /&gt;evLog.Source = &quot;ASPnetBible&quot;&lt;br /&gt;&#39; Note: this listing does not show the&lt;br /&gt;&#39; complete message for brevity&lt;br /&gt;evLog.WriteEntry( &quot;...starting&quot;)&lt;br /&gt;Console.WriteLine(&quot;Wrote &#39;starting&#39;...&quot;)&lt;br /&gt;evLog.WriteEntry(&quot;... exiting&quot;)&lt;br /&gt;Console.WriteLine(&quot;Wrote &#39;exit&#39;...&quot;)&lt;br /&gt;End Sub&lt;br /&gt;End Module&lt;br /&gt;&lt;br /&gt;This code is a Visual Basic .NET console application that creates an Event Source called ASPnetBible and logs the application&#39;s starting and exiting events to the system&#39;s Application event log — although the listing doesn&#39;t show it, both messages are informational.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;2. &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa373083%28VS.85%29.aspx&quot;&gt;Performance counters&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;Performance counters are useful for monitoring the health and performance of an application. You can chart the value of using the Performance applet in the Administrative Tools folder of the systems Control Panel. The .NET Framework makes it easy for you to read the value of existing performance counters, such as the system&#39;s percent CPU Utilization, as well as create your own applicationspecific performance counters. The following code demonstrates how to work with &lt;a href=&quot;http://www.scl.ameslab.gov/Projects/Rabbit/&quot;&gt;performance counters&lt;/a&gt; in a simple Windows Forms application:&lt;br /&gt;&lt;br /&gt;&#39; Create a new performace counter&lt;br /&gt;&lt;br /&gt;Dim counterCollection As New CounterCreationDataCollection()&lt;br /&gt;Dim couterItem As New CounterCreationData()&lt;br /&gt;counterName = &quot;demoCounter&quot;&lt;br /&gt;perfCatName = &quot;ASPnetBible&quot;&lt;br /&gt;couterItem.CounterName = counterName&lt;br /&gt;couterItem.CounterType =&lt;br /&gt;PerformanceCounterType.NumberOfItems32&lt;br /&gt;counterCollection.Add(couterItem)&lt;br /&gt;PerformanceCounterCategory.Create(perfCatName, _&lt;br /&gt;&quot;sample counter&quot;, counterCollection)&lt;br /&gt;&#39; ...elsewhere in the application - Increment the counter&lt;br /&gt;Dim perfCounter As PerformanceCounter&lt;br /&gt;perfCounter = New PerformanceCounter()&lt;br /&gt;perfCounter.CategoryName = perfCatName&lt;br /&gt;perfCounter.CounterName = counterName&lt;br /&gt;perfCounter.ReadOnly = False&lt;br /&gt;perfCounter.IncrementBy(50)&lt;br /&gt;System.Threading.Thread.Sleep(2000)&lt;br /&gt;perfCounter.IncrementBy(-50)&lt;br /&gt;&#39;...elsewhere in the application - Delete the sample counter&lt;br /&gt;PerformanceCounterCategory.Delete(perfCatName)&lt;br /&gt;&lt;br /&gt;This code demonstrates how to create a new performance counter category and counter using the CouterCreationDataCollection and CouterCreationData classes — the fragment shown is from the sample application&#39;s Load event handler. In the next section of the code, from a button&#39;s Click event handler, the code creates an instance of the sample performance counter, increments it, and waits two seconds before decrementing the counter. The last part of the code shows how to delete the performance counter when the form closes.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;3. &lt;a href=&quot;http://en.wikipedia.org/wiki/Tracing&quot;&gt;Tracing&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;Debugging an application by using the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/sc65sadd.aspx&quot;&gt;Visual Studio .NET debugger&lt;/a&gt; is a great way to  track down problems; however, there are many scenarios in which things happen too quickly to follow interactively or in which you simply need to know the sequence of events that lead to a problem before the problem occurs. Tracing is an alternative to using a debugger to step through each line of code as your application executes. You can configure ASP.NET tracing by using two methods: pagelevel tracing and application-level tracing. Both types of tracing provide similar results; however, the difference is in how you access the results for each approach. Page-level tracing provides trace details on the ASPX page when it completes executing, and application-level tracing stores the details of the trace in a file called (by default)&lt;a href=&quot;http://www.velocityreviews.com/forums/t92877-pageload-during-traceacx.html&quot;&gt; trace.acx&lt;/a&gt;, which is located in the same directory as the &lt;a href=&quot;http://msdn.microsoft.com/en-us/asp.net/default.aspx&quot;&gt;ASP.NET&lt;/a&gt; application — you can view the file by using your browser. When you enable tracing, which is disabled by default, ASP.NET records detailed information about the page request, trace messages, control information, cookies, header information, the contents of any form fields, and a raw output of the contents of server variables (like  CONTENT_TYPE and HTTP_REFERRER). Table 1-1 shows a fragment of a trace output from a simple ASP.NET page.&lt;br /&gt;Table 1-1: Fragment of an ASP.NET Page Trace&lt;br /&gt;Category Message From&lt;br /&gt;First(s)&lt;br /&gt;From&lt;br /&gt;Last(s)&lt;br /&gt;aspx.page Begin Init&lt;br /&gt;aspx.page End Init 0.000096 0.000096&lt;br /&gt;aspx.page Begin&lt;br /&gt;LoadViewStat&lt;br /&gt;e&lt;br /&gt;0.000189 0.000092&lt;br /&gt;aspx.page End&lt;br /&gt;LoadViewStat&lt;br /&gt;e&lt;br /&gt;0.000308 0.000119&lt;br /&gt;aspx.page Begin&lt;br /&gt;ProcessPostD&lt;br /&gt;ata&lt;br /&gt;0.000393 0.000085&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asp-dot-net-bible.blogspot.com/feeds/371746390152133401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://asp-dot-net-bible.blogspot.com/2009/02/event-logging-windows-2000-and-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2369916699123161486/posts/default/371746390152133401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2369916699123161486/posts/default/371746390152133401'/><link rel='alternate' type='text/html' href='http://asp-dot-net-bible.blogspot.com/2009/02/event-logging-windows-2000-and-windows.html' title='Three types of Runtime diagnostics:Event logging,Performance counters,Tracing'/><author><name>Bhupesh</name><uri>http://www.blogger.com/profile/14355456892296615865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2369916699123161486.post-7316361589277290023</id><published>2009-01-31T02:42:00.000-08:00</published><updated>2009-02-10T10:09:01.098-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Benefits of the .NET Framework"/><category scheme="http://www.blogger.com/atom/ns#" term="Chapter 1"/><title type='text'>Benefits of the .NET Framework</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;The &lt;/span&gt;&lt;a style=&quot;font-weight: bold;&quot; href=&quot;http://en.wikipedia.org/wiki/.NET_Framework&quot;&gt;.NET Framework&lt;/a&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; offers a number of benefits to developers:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;1. A consistent &lt;/span&gt;&lt;a style=&quot;font-weight: bold;&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb412169.aspx&quot;&gt;programming model&lt;br /&gt;&lt;/a&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;2. Direct support for &lt;a href=&quot;http://www.tropsoft.com/pcsecurity/&quot;&gt;security&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;3. Simplified development efforts&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;4. Easy &lt;/span&gt;&lt;a style=&quot;font-weight: bold;&quot; href=&quot;http://www.appdeploy.com/&quot;&gt;application deployment&lt;/a&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; and maintenance&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style=&quot;font-weight: bold;&quot; href=&quot;http://en.wikipedia.org/wiki/Parallel_programming_model&quot;&gt;1. Programming model&lt;/a&gt;&lt;br /&gt;Different programming languages offer different models for doing the same thing. For example, the following code demonstrates how to open a file and write a one-line message to it using Visual Basic 6.0:&lt;br /&gt;&lt;br /&gt;Public Sub testFileAccess()&lt;br /&gt;On Error GoTo handle_Error&lt;br /&gt;&#39; Use native method of opening an writing to a file...&lt;br /&gt;Dim outputFile As Long&lt;br /&gt;outputFile = FreeFile&lt;br /&gt;Open &quot;c:\temp\test.txt&quot; For Output As #outputFile&lt;br /&gt;Print #outputFile, &quot;Hello World!&quot;&lt;br /&gt;Close #outputFile&lt;br /&gt;&lt;br /&gt;&#39; Use the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa164509%28office.10%29.aspx&quot;&gt;Microsoft Scripting Runtime&lt;/a&gt; to&lt;br /&gt;&#39; open and write to the file...&lt;br /&gt;&lt;br /&gt;Dim fso As Object&lt;br /&gt;Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)&lt;br /&gt;Dim outputText As TextStream&lt;br /&gt;Set outputText = fso.CreateTextFile(&quot;c:\temp\test2.txt&quot;)&lt;br /&gt;outputText.WriteLine &quot;Hello World!&quot;&lt;br /&gt;outputText.Close&lt;br /&gt;Set fso = Nothing&lt;br /&gt;Exit Sub&lt;br /&gt;handle_Error:&lt;br /&gt;&#39; Handle or report error here&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;This code demonstrates that more than one technique is available to create and write to a new file. The first method uses Visual Basic&#39;s built-in support; the second method uses the &lt;a href=&quot;http://support.microsoft.com/kb/254166&quot;&gt;Microsoft Scripting Runtime&lt;/a&gt;. &lt;a href=&quot;http://www.cplusplus.com/doc/tutorial/&quot;&gt;C++ &lt;/a&gt;also offers more than one way of performing the same task, as shown in the following code:&lt;br /&gt;&lt;br /&gt;#include&lt;br /&gt;#include&lt;br /&gt;#include&lt;br /&gt;#include&lt;br /&gt;using namespace std;&lt;br /&gt;int main(int argc, char* argv[])&lt;br /&gt;{&lt;br /&gt;// Use the C Runtime Library (CRT)...&lt;br /&gt;FILE *testFile;&lt;br /&gt;if( (testFile = fopen( &quot;c:\\temp\\test3.txt&quot;,&lt;br /&gt;&quot;wt&quot; )) == NULL ) {&lt;br /&gt;cout &lt;&lt; &quot;Could not open first test file!&quot; &lt;&lt; style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Visual Basic .NET: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Imports System.IO&lt;br /&gt;Imports System.Text&lt;br /&gt;Module Demo&lt;br /&gt;Sub Main()&lt;br /&gt;Dim outputFile As StreamWriter = _ New StreamWriter(&quot;c:\temp\test5.txt&quot;)&lt;br /&gt;outputFile.WriteLine(&quot;Hello World!&quot;)&lt;br /&gt;outputFile.Close()&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;End Module&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/vcsharp/default.aspx&quot;&gt;&lt;b&gt;Visual C# .NET:&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Text;&lt;br /&gt;class Demo&lt;br /&gt;{&lt;br /&gt;static void Main()&lt;br /&gt;{&lt;br /&gt;StreamWriter outputFile = new StreamWriter(&quot;c:\\temp\\test6.txt&quot;);&lt;br /&gt;outputFile.WriteLine(&quot;Hello World!&quot;);&lt;br /&gt;outputFile.Close();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The preceding code demonstrates, apart from slight syntactical differences, that the technique for writing to a file in either language is identical — both listings use the StreamWriter class to write the &quot;Hello World!&quot; message out to the text files. In fact, unlike the Visual Basic and Visual &lt;a href=&quot;http://en.wikipedia.org/wiki/C%2B%2B&quot;&gt;C++&lt;/a&gt; listings, which demonstrate that there&#39;s more than one way to do something within the same language, the preceding listings show that there&#39;s a unified means of accomplishing the same task by using the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms229335.aspx&quot;&gt;.NET Class Library&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The .NET Class Library is a key component of the .&lt;a href=&quot;http://msdn.microsoft.com/en-us/netframework/aa569263.aspx&quot;&gt;NET Framework &lt;/a&gt;— it is sometimes referred to as the &lt;a href=&quot;http://en.wikipedia.org/wiki/Base_Class_Library&quot;&gt;Base Class Library&lt;/a&gt; (BCL). The .NET Class Library contains hundreds of classes you can use for tasks such as the following:&lt;br /&gt;1. Processing XML&lt;br /&gt;2. Working with data from multiple data sources&lt;br /&gt;3. Debugging your code and working with event logs&lt;br /&gt;4. Working with data streams and files&lt;br /&gt;5. Managing the run-time environment&lt;br /&gt;6. Developing Web services, components, and standard Windows applications&lt;br /&gt;7. Working with application security&lt;br /&gt;8. Working with directory services&lt;br /&gt;&lt;br /&gt;The functionality that the &lt;a href=&quot;http://www.webreference.com/js/tips/020421.html&quot;&gt;.NET Class Library&lt;/a&gt; provides is available to all .NET languages, resulting in a consistent object model regardless of the programming language developers use.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;2. Direct support for&lt;a href=&quot;http://cotojo.wordpress.com/&quot;&gt; security&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;Developing an application that resides on a user&#39;s desktop system and uses local resources is easy, from a security point of view, because security simply isn&#39;t a consideration in this scenario. &lt;a href=&quot;http://www.pcsecurityshield.com/&quot;&gt;Security&lt;/a&gt; becomes much more important when you create applications that access data on remote systems or applications that perform privileged tasks on behalf of non privileged users, because systems may have to authenticate users, and encryption (scrambling to avoid eavesdropping) may be necessary to secure data communications.&lt;br /&gt;&lt;br /&gt;Windows NT, Windows 2000, and Windows XP have a number of security features based on Access Control Lists (ACLs). An ACL contains a number of entries that specify which users may access, or are explicitly denied access, to resources such as files and printers. ACLs are a great way of protecting executable files (applications) from unauthorized access, but they do not secure all parts of the file. The &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&quot;&gt;.NET Framework &lt;/a&gt;enables both developers and system administrators to specify method-level security. Developers (through easy-to-use programming language constructs called attributes) and systems administrators (by using administrative tools and byediting an application&#39;s configuration file) can configure an application&#39;s security so that only authorized users can invoke a component&#39;s methods.&lt;br /&gt;&lt;br /&gt;The &lt;a href=&quot;http://cplus.about.com/od/introductiontoprogramming/g/dotnetdefn.htm&quot;&gt;.NET Framework&lt;/a&gt; uses industry-standard protocols such as TCP/IP and means of communications such as the Extensible Markup Language (XML), Simple Object Access Protocol (SOAP, a standard application messaging protocol), and HTTP to facilitate distributed application communications. This makes distributed computing more secure, because .NET developers cooperate with network connectivity devices as opposed to attempting to work around their security restrictions.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;3. Simplified development efforts&lt;/span&gt;&lt;br /&gt;Two aspects of creating Web-based applications present unique challenges to Web developers: visual page design and debugging applications. Visual page design is straightforward when creating static content; however, when you need to present the result of executing a query in a tabular format using an ASP page, page design can get rather involved. This is because developers need to mix traditional ASP code, which represents the application&#39;s logic, and HTML, which represents the resentation of the data. &lt;a href=&quot;http://en.wikipedia.org/wiki/ASP.NET&quot;&gt;ASP.NET&lt;/a&gt; and the &lt;a href=&quot;http://www.google.co.in/search?hl=en&amp;amp;defl=en&amp;amp;q=define:.NET+Framework&amp;amp;ei=BsCRSZPgNo_JkAXm--DyCw&amp;amp;sa=X&amp;amp;oi=glossary_definition&amp;amp;ct=title&quot;&gt;.NET Framework&lt;/a&gt; simplify development by allowing developers to separate an  application&#39;s logic from its presentation, resulting in an easier-to-maintain code base. &lt;a href=&quot;http://www.asp.net/&quot;&gt;ASP.NET&lt;/a&gt; can also handle the details of maintaining the state of controls, such as the contents of text boxes, between calls to the same ASP.NET page, thereby reducing the amount of code you need to write. Visual Studio .NET, which is tightly integrated with the .NET Framework, assists developers as they create &lt;a href=&quot;http://www.w3schools.com/ASPNET/default.asp&quot;&gt;ASP.NET&lt;/a&gt; and other applications by providing visual designers that facilitate visual drag and drop editing, making page layout and form layout a breeze.&lt;br /&gt;&lt;br /&gt;Another aspect of creating applications is debugging. Developers sometimes make mistakes; systems don&#39;t behave as you expect them to, and unexpected conditions arise — all of these issues are collectively referred to as, using the affectionate term, &quot;bugs.&quot; Tracking down bugs — known as&lt;a href=&quot;http://en.wikipedia.org/wiki/Debug&quot;&gt; &quot;debugging&quot; &lt;/a&gt;— quickly and effectively requires developers to be familiar with a variety of tools, sometimes available from a third party, and techniques — a combination of programming techniques and techniques for using a particular tool. The &lt;a href=&quot;http://www.geekpedia.com/definition3_.NET-Framework.html&quot;&gt;.NET Framework &lt;/a&gt;simplifies debugging with support for Runtime diagnostics.&lt;br /&gt;&lt;br /&gt;Runtime diagnostics not only help you track down bugs but also help you determine how well your applications perform and assess the condition of your application. The .NET Framework provides three types of Runtime diagnostics:&lt;br /&gt;1. Event logging&lt;br /&gt;2. Performance counters&lt;br /&gt;3. Tracing&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asp-dot-net-bible.blogspot.com/feeds/7316361589277290023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://asp-dot-net-bible.blogspot.com/2009/01/benefits-of-net-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2369916699123161486/posts/default/7316361589277290023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2369916699123161486/posts/default/7316361589277290023'/><link rel='alternate' type='text/html' href='http://asp-dot-net-bible.blogspot.com/2009/01/benefits-of-net-framework.html' title='Benefits of the .NET Framework'/><author><name>Bhupesh</name><uri>http://www.blogger.com/profile/14355456892296615865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2369916699123161486.post-3358264497991659934</id><published>2009-01-31T02:34:00.000-08:00</published><updated>2009-02-10T10:28:37.585-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Chapter 1"/><category scheme="http://www.blogger.com/atom/ns#" term="Introduction"/><category scheme="http://www.blogger.com/atom/ns#" term="Overview"/><title type='text'>Understanding the .NET Framework</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;The &lt;a href=&quot;http://www.sics.se/%7Epsm/ar97/&quot;&gt;Internet revolution&lt;/a&gt; of the late 1990s represented a dramatic shift in the way individuals and organizations communicate with each other. Traditional applications, such as word processors and accounting packages, are modeled as stand-alone applications: they offer users the capability to perform tasks using data stored on the system the application resides and executes on. Most new software, in contrast, is modeled based on a distributed computing model where applications collaborate to provide services and expose functionality to each other. As a result, the primary role of most new software is changing into supporting information exchange (through Web servers and browsers), collaboration (through e-mail and instant messaging), and individual expression (through Web logs, also known as &lt;a href=&quot;http://blogsearch.google.com/&quot;&gt;Blogs&lt;/a&gt;, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Ezine&quot;&gt;e-zines&lt;/a&gt; — Web based magazines). Essentially, the basic role of software is changing from providing discrete functionality to providing services.&lt;br /&gt;&lt;br /&gt;The .NET Framework represents a unified, object-oriented set of services and libraries that embrace the changing role of new network-centric and network-aware software. In fact, the .NET Framework is the first platform designed from the ground up with the Internet in mind.&lt;br /&gt;&lt;br /&gt;This chapter introduces the .NET Framework in terms of the benefits it provides. I&lt;br /&gt;present some sample code in &lt;a href=&quot;http://www.microsoft.com/express/vcsharp/&quot;&gt;Visual C#&lt;/a&gt; .NET, Visual Basic .NET, &lt;a href=&quot;http://www.freetutes.com/&quot;&gt;Visual Basic 6.0&lt;/a&gt;, and Visual C++; don&#39;t worry if you&#39;re not familiar with these languages, since I describe in the discussion what each sample does.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asp-dot-net-bible.blogspot.com/feeds/3358264497991659934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://asp-dot-net-bible.blogspot.com/2009/01/understanding-net-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2369916699123161486/posts/default/3358264497991659934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2369916699123161486/posts/default/3358264497991659934'/><link rel='alternate' type='text/html' href='http://asp-dot-net-bible.blogspot.com/2009/01/understanding-net-framework.html' title='Understanding the .NET Framework'/><author><name>Bhupesh</name><uri>http://www.blogger.com/profile/14355456892296615865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>