<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="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" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7606172489424649636</atom:id><lastBuildDate>Mon, 16 Sep 2024 03:40:48 +0000</lastBuildDate><category>C# Tutorial</category><category>csharptutorial</category><category>Tutorial</category><category>C#</category><category>Information-Technology-Articles</category><category>Developers-Corner</category><title>Programming And Technical Tutorials</title><description></description><link>http://dotnetcsharptutorial.blogspot.com/</link><managingEditor>noreply@blogger.com (Wiseman)</managingEditor><generator>Blogger</generator><openSearch:totalResults>43</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-8486175354402986499</guid><pubDate>Thu, 01 Jun 2023 14:48:00 +0000</pubDate><atom:updated>2023-06-01T07:58:52.440-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Developers-Corner</category><category domain="http://www.blogger.com/atom/ns#">Information-Technology-Articles</category><title>ASP.NET Security Best Practices 2023: How to Secure Your Web Applications</title><description>&lt;h1 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-large;&quot;&gt;ASP.NET Security&lt;/span&gt;&lt;/h1&gt;&lt;p class=&quot;ParagraphTextStyle&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;ASP.NET is a powerful framework for developing web
applications on the Microsoft platform. It provides many features and tools to
help developers create secure and reliable web applications. However, security
is not something that can be achieved by simply using a framework. Developers
need to follow some best practices and guidelines to prevent common
vulnerabilities and risks in their web applications.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;In this article, we will discuss some of the best
practices to secure ASP.NET web applications in 2023. We will cover topics such
as cross-site scripting (XSS), SQL injection, cross-site request forgery
(CSRF), custom error page for error handling, and more.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-large;&quot;&gt;&lt;b&gt;What is ASP.NET Security?&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;ASP.NET security is the process of protecting your
web applications from unauthorized access, data breaches, or malicious attacks.
ASP.NET security works in conjunction with Internet Information Services (IIS)
security and includes authentication and authorization services to implement
the ASP.NET security model. ASP.NET also includes a role-based security feature
that you can implement for both Windows and non-Windows user accounts.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;ASP.NET security is not a one-time task, but an
ongoing process that requires constant monitoring, testing, and updating.
Developers should always keep themselves updated with the latest security
trends, tools, and techniques, and apply them accordingly to their web
applications.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;How to Prevent Cross-Site Scripting (XSS) Attacks?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Cross-site scripting (XSS) is a type of attack that
inserts malicious code into a web page that is viewed by other users. The
malicious code can steal cookies, session tokens, or other sensitive
information from the victim&#39;s browser, or perform actions on behalf of the
victim, such as sending messages or transferring funds. XSS attacks can be
classified into two types: reflected XSS and stored XSS. Reflected XSS occurs
when the malicious code is embedded in a URL or a query string that is sent to
the server and then reflected back to the browser. Stored XSS occurs when the
malicious code is stored in a database or a file on the server and then
displayed to the browser.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;To prevent XSS attacks, ASP.NET developers should
follow these best practices:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Use HTML
encoding to escape user input before displaying it on the web page. HTML
encoding converts special characters such as &amp;lt;, &amp;gt;, &quot;, and &amp;amp; into
their corresponding HTML entities such as &amp;lt;, &amp;gt;, &quot;, and &amp;amp;. This
prevents the browser from interpreting them as HTML tags or attributes. ASP.NET
provides several methods for HTML encoding, such as HttpUtility.HtmlEncode,
WebUtility.HtmlEncode, HtmlHelper.Encode, and Razor syntax @.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Use
content security policy (CSP) to restrict the sources of scripts and other
resources that can be loaded by the browser. CSP is a HTTP header that tells
the browser which domains are allowed to provide scripts, stylesheets, images,
fonts, etc. for the web page. This prevents malicious scripts from being
injected by third-party sources or inline scripts. ASP.NET supports CSP through
the Content-Security-Policy header or the Content-Security-Policy-Report-Only
header.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Use
anti-XSS libraries or tools to validate user input and sanitize output.
Anti-XSS libraries or tools can detect and remove malicious scripts or tags from
user input or output. They can also provide additional features such as
white-listing, black-listing, custom rules, etc. Some examples of anti-XSS
libraries or tools for ASP.NET are Microsoft AntiXSS Library, OWASP .NET HTML
Sanitizer, HtmlSanitizer.NET, etc.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;





&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-large;&quot;&gt;&lt;b&gt;How to Prevent SQL Injection Attacks?&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;SQL injection is a type of attack that exploits a
vulnerability in a database query that is constructed from user input. The
attacker can inject malicious SQL statements into the query that can execute arbitrary
commands on the database server, such as reading, modifying, or deleting data,
or executing system commands. SQL injection can result in data breaches, data
corruption, or denial of service.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;To prevent SQL injection attacks, ASP.NET
developers should follow these best practices:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Use
parameterized SQL commands for all data access, without exception.
Parameterized SQL commands separate the query structure from the user input
values, and pass them as parameters to the database server. This prevents the
user input values from being interpreted as part of the query syntax.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;ASP.NET
provides several classes for parameterized SQL commands, such as&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;ParagraphTextStyle&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;SqlCommand&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;OleDbCommand&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;OdbcCommand&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;





&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Use entity
framework (EF) or other object-relational mapping (ORM) tools for data access.
EF or ORM tools abstract the database operations into objects and methods that
are easier to use and maintain. They also generate parameterized SQL commands
automatically for data access operations.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Some examples of EF or ORM tools for
ASP.NET are&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;ParagraphTextStyle&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Entity Framework Core (EF Core)&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Dapper.NET&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;NHibernate&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;



&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Use stored
procedures for complex queries or transactions. Stored procedures are
pre-defined SQL statements that are stored on the database server and executed
by calling their names and passing parameters. Stored procedures can improve
performance,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;security&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;and maintainability of database operations.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;They can also implement additional logic or
validations on the database side.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;How to Prevent Cross-Site Request Forgery (CSRF)
Attacks?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Cross-site request forgery (CSRF) is a type of
attack that forces a user to perform an unwanted action on a web application
that they are already logged into. The attacker can craft a malicious link or
form that sends a request to the web application with the user&#39;s credentials or
session token attached. The web application then executes the request as if it
was initiated by the user. CSRF attacks can cause damage such as changing
passwords,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;transferring funds,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;deleting accounts&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;etc.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;span&gt;To prevent CSRF attacks,&amp;nbsp;&lt;/span&gt;ASP.NET developers should follow these best
practices:&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Use
anti-forgery tokens for all state-changing requests (POST,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;PUT,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;DELETE). Anti-forgery tokens are random values that
are generated by the server and embedded in hidden fields in forms or headers
in requests.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The server then validates these tokens before
processing&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;the requests.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;This ensures that only requests that originate from&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;the web application are accepted by&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;the server.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;ASP.NET provides built-in support for anti-forgery
tokens through&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;the @Html.AntiForgeryToken helper method in Razor
views&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;the [ValidateAntiForgeryToken] attribute in MVC
controllers.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;Use
same-site cookies for session management.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Same-site cookies are cookies that are only sent
with requests&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;that originate from&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;the same site (domain) as&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;the cookie originator.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;This prevents third-party sites from sending
requests with cookies attached&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;to them.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;ASP.NET supports same-site cookies through&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;the SameSite property of HttpCookie class&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;or CookieOptions class.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-large;&quot;&gt;&lt;b&gt;How to Implement Custom Error Page for Error
Handling?&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Error handling is an important aspect of web
application development that deals with how to handle unexpected errors or
exceptions that occur during runtime.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Error handling can improve user experience,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;security,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;and debugging of web applications.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;To implement error handling in ASP.NET web
applications,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;developers should follow these best practices:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Use custom
error pages for displaying user-friendly messages when errors occur.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;span&gt;&lt;span&gt;Custom error pages can hide sensitive information
such as stack traces&amp;nbsp;&lt;/span&gt;&lt;span&gt;or server details from users&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;and provide helpful instructions&amp;nbsp;&lt;/span&gt;&lt;span&gt;or links for resolving errors.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Custom error pages can also log errors for further
analysis&amp;nbsp;&lt;/span&gt;&lt;span&gt;or reporting purposes.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;Use global
exception handlers for catching unhandled exceptions at application level.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;span&gt;Global exception handlers can handle exceptions
that are not caught by try-catch blocks&amp;nbsp;&lt;/span&gt;&lt;span&gt;or specific exception handlers at controller level&amp;nbsp;&lt;/span&gt;&lt;span&gt;or action level.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;span&gt;Global exception handlers can also perform common
actions such as logging errors&amp;nbsp;&lt;/span&gt;or redirecting users to custom error pages.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;span&gt;Use error
filters for applying custom logic&amp;nbsp;&lt;/span&gt;&lt;span&gt;or &lt;/span&gt;behaviour&lt;span&gt;&amp;nbsp;based on error types&amp;nbsp;&lt;/span&gt;&lt;span&gt;or conditions.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;span&gt;&lt;span&gt;Error filters are attributes that can be applied to
controllers&amp;nbsp;&lt;/span&gt;&lt;span&gt;or actions&amp;nbsp;&lt;/span&gt;&lt;span&gt;to handle specific errors&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;or exceptions that occur during execution.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Error filters can also override global exception
handlers if needed.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-large;&quot;&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;ASP.NET security is not something that can be taken
lightly by developers who want to create secure and reliable web applications
on Microsoft platform. By following some of these best practices, developers
can prevent common vulnerabilities and risks in their web applications.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;ParagraphTextStyle&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;However, security is not a one-time task, but an ongoing process that
requires constant monitoring, testing, and updating. Developers should
always keep themselves updated with latest security trends, tools, and
techniques, and apply them accordingly to their web applications.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2023/06/aspnet-security-best-practices-2023-how.html</link><author>noreply@blogger.com (Wiseman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-6483360836958616868</guid><pubDate>Thu, 25 Jun 2015 22:07:00 +0000</pubDate><atom:updated>2017-09-17T10:06:49.929-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Information-Technology-Articles</category><title>Make Website Compatible With Mobile Devices And Increase Your Reach</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;Have you ever wondered on &lt;b&gt;how to make a website for mobile phones&lt;/b&gt; or &lt;b&gt;how to make website compatible with mobile browsers or devices&lt;/b&gt;? If yes then continue reading as in this post I am going to provide you a list of service providers who are best in this business.&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br&gt;&lt;/span&gt;


&lt;br&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: large;&quot;&gt;Leveraging on the mobile phone revolution&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;Mobile phones have revolutionized the society in a way that no one ever have done in the past. There are around seven billion people on earth and nearly six billion mobile phone subscribers. With affordable internet and with the rise of middle class around the globe more and more people are  using their mobile devices to browse the internet. Under these circumstances if you are not converting your website to a mobile or tablet friendly site then you will lose the competition.&lt;/span&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2015/06/make-your-website-compatible-with-mobile-devices.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2015/06/make-your-website-compatible-with-mobile-devices.html</link><author>noreply@blogger.com (Wiseman)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinsF4dwS-q-vTLG7Z9ykv_vL6WtQBzikW5NJMrG9PwBELv7jXI_JlWWmKhTOzytHx5_xklYcmIE8iT8jrQr2NipOclnu0rx1UVwzJ-PavfBxzdHgN51vQXveox-oPx7h7tYPNSVp6fP6DT/s72-c/Mobile+Site+Provider+-+mobisitegalore.png" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-7384153309196606219</guid><pubDate>Sun, 14 Jun 2015 22:43:00 +0000</pubDate><atom:updated>2015-06-14T15:48:32.642-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Developers-Corner</category><title>How To: Factorial Program In C# .Net</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: large;&quot;&gt;What is a factorial&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: large;&quot;&gt;?&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A factorial is the result of an integer multiplied by all the integers less than it. &lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;For example if you want to know the factorial of 3 then it can be calculated as 3*2*1 = 6. So factorial of 3 is 6. Similarly factorial of 5 is 5*4*3*2*1 = 120. &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Note that factorial is always calculated for &lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;non-negative&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; integers. So there is nothing like negative factorials. &lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In Algebra an exclamatory symbol (!) is used as a factorial notation.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So if we want to calculate factorial of 5 then we can write it as below:&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;5! = 120. &lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So &lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;how to find factorial of a number like 0? &lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;Answer is, factorial of 0 is always 1.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2015/06/How-to-factorial-program-in-csharp-net.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2015/06/How-to-factorial-program-in-csharp-net.html</link><author>noreply@blogger.com (Wiseman)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-1765968001232747513</guid><pubDate>Sun, 07 Jun 2015 20:47:00 +0000</pubDate><atom:updated>2015-06-13T14:04:17.964-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Information-Technology-Articles</category><title>Top 10 Articles From MSDN Magazine That Every .NET Developer Must Read</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Recently I was going through few MSDN magazines and found some really useful articles for .NET developers. Although there are lot of valuable articles in &lt;a href=&quot;https://msdn.microsoft.com/en-us/magazine/default.aspx&quot; target=&quot;_blank&quot;&gt;MSDN magazines&lt;/a&gt; but I thought to create my own list of Top 10 that I think will be useful to .NET developers.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2015/06/top-10-articles-from-msdn-magazine-for-dotnet-developers.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2015/06/top-10-articles-from-msdn-magazine-for-dotnet-developers.html</link><author>noreply@blogger.com (Wiseman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-7722175174814850775</guid><pubDate>Fri, 16 May 2014 16:45:00 +0000</pubDate><atom:updated>2015-06-27T13:18:24.233-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><title>C# Multidimensional and Jagged Arrays Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
As described earlier, an &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-arrays.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;array&lt;/a&gt; is used to store same type of data.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Classification of Arrays&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Arrays in C# can be classified as below:&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Single-Dimensional Arrays&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Multidimensional Arrays&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Jagged Arrays&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Arrays with single dimension has been discussed in the earlier chapters of this tutorial. In this chapter we will discuss &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Multidimensional&lt;/strong&gt; and &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Jagged&lt;/strong&gt; arrays.&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-multidimensional-and-jagged.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-multidimensional-and-jagged.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-8057318803014397268</guid><pubDate>Fri, 16 May 2014 16:43:00 +0000</pubDate><atom:updated>2015-06-27T13:18:32.449-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Hashtable Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
A C# Hashtable represents a collection in which objects are stored and retrieved using a key.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Each key in a Hashtable has a hash code using which the objects in a Hashtable are organized.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Create a Hashtable in C#&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
A Hashtable can be created using the below code:&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    Hashtable shoppingCart = new Hashtable();&lt;/pre&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-hashtable.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-hashtable.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-1479719659432505182</guid><pubDate>Fri, 16 May 2014 16:42:00 +0000</pubDate><atom:updated>2015-06-27T13:18:39.398-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Stack Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Stack is a type of collection in which the item stored last is retrieved first. This behaviour is also called as &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;LIFO&lt;/strong&gt; i.e. Last In First Out.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Inserting an item into a Stack is called as &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Pushing&lt;/strong&gt; and removing an item is called as &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Popping&lt;/strong&gt;.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Important features of C# Stack class&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Below are some of the important features of a Stack class.&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Stack allows Null values.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Stak allows duplicate values.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;It has both generic and non-generic versions.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-stack.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-stack.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-74785174109498958</guid><pubDate>Fri, 16 May 2014 16:42:00 +0000</pubDate><atom:updated>2015-06-27T13:18:52.542-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Queue Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Queue is a type of collection in which the item stored first is retrieved first. This behaviour is also called as &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;FIFO&lt;/strong&gt; i.e. First In First Out.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Inserting an item into a Queue is called as &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Enqueuing&lt;/strong&gt; and removing an item is called as &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Dequeuing&lt;/strong&gt;.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Important features of C# Queue class&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Below are some of the important features of a Queue class.&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Null values can be stored in Queue.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Duplicate values can be stored in Queue.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;It has both generic and non-generic versions.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-queue.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-queue.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-6886963512153104445</guid><pubDate>Fri, 16 May 2014 16:42:00 +0000</pubDate><atom:updated>2015-06-27T13:19:01.173-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Arraylist Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
An Arraylist is a collection which can store any item of type object. The number of objects can dynamically increase or decrease.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Important features of C# Arraylist class&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Below are some of the important features of an Arraylist class.&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Arraylist is a weakly typed collection object.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Arraylist may or may not be sorted by default.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;It can store billions of elements.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;To access an item in an Arraylist indexes are used.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;It allows null values.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;It allows duplicate elements.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Performance wise Arraylist is slower compared to generic &lt;a href=&quot;http://www.tutorialnode.com/2014/05/csharp-list.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;List&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-arraylist.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-arraylist.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-1160902635383063108</guid><pubDate>Fri, 16 May 2014 16:42:00 +0000</pubDate><atom:updated>2015-06-27T13:19:11.178-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# List Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
C# List is one of the most popular collection &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-classes.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;class&lt;/a&gt;. A &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;List&lt;/strong&gt; object can dynamically increase or decrease in size.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Another collection class &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-arraylist.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Arraylist&lt;/a&gt; is also similar to a List class. The primary difference between an Arraylist and a List is that a List is strongly typed class whereas an Arraylist is not.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
What is a Strongly Typed Collection Class?&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
When the type of objects that can be stored in a collection class can be predefined then those type of Collection Classes are called as strongly typed.&lt;/div&gt;
&lt;table class=&quot;lamp&quot; style=&quot;background-color: white; border: 1px solid rgb(212, 212, 212); color: black; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify; width: 601px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;border: 0px; margin: 0px 15px; padding: 10px 5px 10px 10px; width: 32px;&quot;&gt;&lt;/th&gt;&lt;td style=&quot;border: 0px; margin: 0px; padding: 4px 10px 4px 0px; vertical-align: middle;&quot;&gt;These type of classes for which data type can be predefined are called as Generic types. In C#, the generic List class is available.&lt;br&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-list.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-list.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-3553392900212858742</guid><pubDate>Fri, 16 May 2014 16:42:00 +0000</pubDate><atom:updated>2015-06-27T13:19:19.774-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Dictionary Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
A C# Dictionary is one of the most important and widely used collections classes. It consists of keys and corresponding values.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Dictionary&amp;lt;Tkey,Tvalue&amp;gt;&lt;/b&gt; is a generic class so the datatype of the keys and the values can be pre defined. Performance wise Dictionary objects are very efficient.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Initialize Dictionary object&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Initialization of a Dictionary&amp;lt;Tkey,Tvalue&amp;gt; object can be done as shown below:&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    Dictionary&amp;lt;string, string&amp;gt; dictFruits = new Dictionary&amp;lt;string, string&amp;gt;();
    &lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
In the above example the dictionary object has a &lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;key &lt;/b&gt;of datatype &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;string&lt;/i&gt; and &lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;value&lt;/b&gt; of datatype &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;string&lt;/i&gt;.&lt;/div&gt;
&lt;table class=&quot;lamp&quot; style=&quot;background-color: white; border: 1px solid rgb(212, 212, 212); color: black; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify; width: 601px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;border: 0px; margin: 0px 15px; padding: 10px 5px 10px 10px; width: 32px;&quot;&gt;&lt;/th&gt;&lt;td style=&quot;border: 0px; margin: 0px; padding: 4px 10px 4px 0px; vertical-align: middle;&quot;&gt;The Dictionary generic class is part of &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;System.Collections.Generic&lt;/strong&gt; namespace.&lt;br&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-dictionary.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-dictionary.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-9192432717597837463</guid><pubDate>Fri, 16 May 2014 16:42:00 +0000</pubDate><atom:updated>2015-06-27T13:17:57.517-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Collections Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Collections helps in storage of data in an orderly way. The data stored in a Collection are called as items or elements. Collections are preferred when the number of items to be stored is not predetermined. Hence, collections are dynamic in nature and their size can increase or decrease during the execution of a program.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
There are various type of collections &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-classes.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;classes&lt;/a&gt; and these can be found in the below namespaces:-&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;System.Collections&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;System.Collections.Generic&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;System.Collections.Specialized&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;System.Collections.Concurrent&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;System.Collections.ObjectModel&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-collections.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-collections.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-6760986890241588927</guid><pubDate>Fri, 16 May 2014 16:41:00 +0000</pubDate><atom:updated>2015-06-27T13:17:49.997-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Generics Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Generics&lt;/strong&gt; in C#.NET allows a Class, Method, Interface or Delegate to be created without the need of using a specific data type within them.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
The assignment of the actual data type is done during the declaration and instantiation of a class, interface and delegate or during the invocation of a method.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Important Features of Generics&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Below some of the important features of C# Generics has been provided.&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Performance wise a generic type is more efficient.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;It guarantees type safety.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;It helps in code reusability.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;It is commonly used in the collection classes.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;.NET framework uses System.collections.generic namespace for all the generic collection classes.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;It allows programmers to create their own generic classes, methods, interfaces, delegate and events.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Type information about types used in a generic data type is only available in runtime. Reflection can be used to get this information.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-generics.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-generics.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-1855068385795151548</guid><pubDate>Fri, 16 May 2014 16:41:00 +0000</pubDate><atom:updated>2015-06-27T13:17:41.140-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Events Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
An event is a way to notify same or other &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-classes.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;classes&lt;/a&gt; on the occurrence of an action.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
The action can be click of a button in a .NET application, key pressed in a keyboard, a mouse click and so on.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Declaring Events&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
In C# Events are declared using &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-delegates.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Delegates&lt;/a&gt;. So to declare an Event first a &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-delegates.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Delegate type&lt;/a&gt; has to be declared.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
In the below code a &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;PrintHandler&lt;/i&gt; Delegate type has been created.&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    public delegate void PrintHandler();
        &lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Once a Delegate type is available an Event can be declared as below:&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    public static event PrintHandler PrintEvent;&lt;/pre&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-events.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-events.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-3266393128093351410</guid><pubDate>Fri, 16 May 2014 16:41:00 +0000</pubDate><atom:updated>2015-06-27T13:17:33.351-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Delegates Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
A Delegate is an object that can hold the address of a &lt;a href=&quot;http://www.tutorialnode.com/2014/05/csharp-methods.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;method&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
A Delegate object can refer only those methods whose signature matches with the Delegate type.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Creating Delegate Types&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Delegate types in C# can be created as below:&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    public delegate void Add(int number1, int number2);   
        &lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
In the above example &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;Add&lt;/i&gt; is the Delegate type and a Delegate object of this type can refer any method that matches the signature of this Delegate type.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Initializing a Delegate&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
A Delegate object can be initialized by referring a method with a matching signature.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
In the below example a method called as &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;AddNumbers&lt;/i&gt; with matching signature is created. Then a Delegate object &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;calculate&lt;/i&gt; of type &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;Add&lt;/i&gt; is initialized with the address of method &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;AddNumbers&lt;/i&gt;.&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;        
    public delegate void Add(int number1, int number2);

    private static void AddNumbers(int firstNumber, int secondNumber)
    {
        Console.WriteLine(firstNumber + secondNumber);
    }

    static void Main(string[] args)
    {
        //Delegate initialized
        Add calculate = AddNumbers;

        Console.ReadLine();
    }      
        &lt;/pre&gt;
&lt;table class=&quot;lamp&quot; style=&quot;background-color: white; border: 1px solid rgb(212, 212, 212); color: black; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify; width: 601px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;border: 0px; margin: 0px 15px; padding: 10px 5px 10px 10px; width: 32px;&quot;&gt;&lt;/th&gt;&lt;td style=&quot;border: 0px; margin: 0px; padding: 4px 10px 4px 0px; vertical-align: middle;&quot;&gt;Delegates in C# are like function pointers used in C and C++.&lt;br&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-delegates.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-delegates.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-2383477177919803289</guid><pubDate>Fri, 16 May 2014 16:41:00 +0000</pubDate><atom:updated>2015-06-27T13:17:23.956-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Reflection Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;standard-div&quot; style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 0px; padding: 0px; text-align: justify; width: 634.875px;&quot;&gt;
&lt;div style=&quot;margin: 10px 15px; padding: 0px;&quot;&gt;
Reflection is a technique using which a program can be modified during runtime. Using reflection a program&amp;#39;s behavior can be manipulated dynamically and a program can be made more adaptable.&lt;/div&gt;
&lt;div style=&quot;margin: 10px 15px; padding: 0px;&quot;&gt;
To work with reflection the required classes are provided in &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;System.Reflection&lt;/strong&gt; namespace.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; height: 1px; margin: 10px 15px; padding: 0px;&quot;&gt;
&lt;h2 style=&quot;font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; line-height: normal; margin: 10px 15px; padding: 0px;&quot;&gt;
Features of C# Reflection&lt;/h2&gt;
&lt;div style=&quot;margin: 10px 15px; padding: 0px;&quot;&gt;
Important features of Reflection are mentioned below.&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;color: #4284b0; margin: 10px 30px; padding: 0px 15px;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Accessing Metadata&lt;/strong&gt; - Ability to access metadata associated with an assembly, class and its members.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Discovering Types&lt;/strong&gt; - Allows to discover the types available in an Assembly.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Late Binding&lt;/strong&gt; - Can be used to get or set properties, invoke methods, access fields of an object dynamically instantiated during runtime. This is also know as &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;dynamic invocation&lt;/strong&gt;.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Reflection Emit&lt;/strong&gt;- Can be used to dynamically create types during runtime.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;margin: 10px 15px; padding: 0px;&quot;&gt;
In this tutorial we will discuss only the first three features as the fourth feature is very rarely used in programming world.&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-reflection.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-reflection.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-3218599118675781056</guid><pubDate>Fri, 16 May 2014 16:41:00 +0000</pubDate><atom:updated>2015-06-27T13:17:14.199-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Attributes Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Attributes allow declarative information or metadata to be associated with an assembly, class, method, property and other programming elements in C#.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
In C#, the Attribute names are enclosed in square brackets [] and mentioned before the class or method name. Some commonly used Attribute names are &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;System.Serializable&lt;/strong&gt; and &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;System.Obsolete&lt;/strong&gt;.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Features of C# Attributes&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
The important features of C# Attributes are discussed below:&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Attributes allows metadata to be added to an assembly or programming element. Metadata is additional data or information about a type or assembly.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;.NET allows one or more attributes to be added to an assembly or programming element like class, method, properties etc.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Internally all the Attributes are defined as a class in .NET Framework.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Like methods and properties, attributes can also have arguments.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;The metadata associated with a programming element can be checked by the same program or another program using a process called as Reflection.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-attributes.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-attributes.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-455880945212393607</guid><pubDate>Fri, 16 May 2014 16:41:00 +0000</pubDate><atom:updated>2015-06-27T13:17:05.052-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Exceptions Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
An exception in C# happens when during the execution of a program an error condition occurs.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
These exceptions can be generated by the program being executed or by another program being called by the current program. Exceptions can also happen due to the environment in which the application is running or due to any external circumstances.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Exception Handling in C#&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
When an exception is not handled properly then .NET runtime abruptly halts the execution of a program.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
If an exception is handled properly then either the program execution can be continued or can be stopped by doing some meaningful activities like logging the error or performing clean up operations.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Exceptions are handled by using &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;try,catch&lt;/strong&gt; and &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;finally&lt;/strong&gt; blocks.&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;try&lt;/strong&gt; - The code which is suspected to generate an exception should be written inside the try block.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;catch&lt;/strong&gt; - The code to handle the exception should be written inside the catch block.&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;finally&lt;/strong&gt; - The code which must be executed whether an exception is thrown or not should be written inside the finally block.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-exceptions.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-exceptions.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-5603137114399303649</guid><pubDate>Fri, 16 May 2014 16:41:00 +0000</pubDate><atom:updated>2015-06-27T13:16:54.868-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Polymorphism Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Polymorphism means an object which has different forms.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Polymorphism is exhibited when different objects expose the same type of &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-methods.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;methods&lt;/a&gt; and &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-properties.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;properties&lt;/a&gt; but with different behavior.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Implementing Polymorphism&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Below ways can be used to achieve polymorphism in C#:&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-interfaces.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Interfaces&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-inheritance.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Inheritance&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Polymorphism through Interfaces&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Polymorphism can be achieved using interfaces. Different &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-classes.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;classes&lt;/a&gt; using the same interface will expose the same methods and properties. These methods from different classes may behave differently.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Lets create an interface &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;ICalculate&lt;/i&gt; having a &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;Calculate&lt;/i&gt; method.&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    public interface ICalculate
    {
        int Calculate(int x, int y);
    }&lt;/pre&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-polymorphism.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-polymorphism.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-368789469235204674</guid><pubDate>Fri, 16 May 2014 16:40:00 +0000</pubDate><atom:updated>2015-06-27T13:16:46.071-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Structs Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
A Struct is a value type and is maintained by .NET runtime on the Stack memory area. The Struct type is usually used for small groups of related variables.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
It is suitable for representing light weight objects such as mathematical objects like Rectangle, Polygons etc. or objects like Color, Employee records etc.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
To declare a struct type the &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;struct&lt;/strong&gt; keyword is used.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Defining C# Structs&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Structs are also called as structures and are efficient in terms of performance.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
In the below example we have created a new user-defined value type called as Rect. Like int, bool etc. we can now declare a variable of type Rect.&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    using System;
    public struct Rect
    {
        public int x, y;

        public Rect(int p1, int p2)
        {
            x = p1;
            y = p2;
        }
    } &lt;/pre&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-structs.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-structs.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-3901688658303686354</guid><pubDate>Fri, 16 May 2014 16:40:00 +0000</pubDate><atom:updated>2015-06-27T13:16:38.332-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Interfaces Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
An interface contains signatures of &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-methods.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;methods&lt;/a&gt;, &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-properties.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;properties&lt;/a&gt;, &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-events.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;events&lt;/a&gt; and indexers.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
A &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-classes.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;class&lt;/a&gt; or &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-structs.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;struct&lt;/a&gt; implementing the interface should provide implementation of the methods, properties, events and Indexers declared in the interface.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Creating Interfaces&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Just like class, an interface is created using the &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;interface&lt;/strong&gt; keyword. &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-access-modifiers.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Access modifiers&lt;/a&gt; cannot be used inside an interface. All the members of an interface are public by default.&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    protected interface ICalculate
    {
        int multiply(int x, int y);
    }
        &lt;/pre&gt;
&lt;table class=&quot;lamp&quot; style=&quot;background-color: white; border: 1px solid rgb(212, 212, 212); color: black; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify; width: 601px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;border: 0px; margin: 0px 15px; padding: 10px 5px 10px 10px; width: 32px;&quot;&gt;&lt;/th&gt;&lt;td style=&quot;border: 0px; margin: 0px; padding: 4px 10px 4px 0px; vertical-align: middle;&quot;&gt;An interface is very similar to an abstract class that has only abstract members.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Implementing Interfaces&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
A class or struct implementing an interface must provide functionalities of all the members declared in an interface.&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    class Calculate: ICalculate
    {
        int result;

        public int multiply(int x, int y)
        {
            result = x * y;
            return result;
        }
    }&lt;/pre&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-interfaces.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-interfaces.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-4336608628390143274</guid><pubDate>Fri, 16 May 2014 16:39:00 +0000</pubDate><atom:updated>2015-06-27T13:16:29.630-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Inheritance Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
The process through which the &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-properties.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;properties&lt;/a&gt; and behavior of an existing &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-classes.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;class&lt;/a&gt; is inherited by another class is called as Inheritance.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
The inheriting class can use the methods of the other class like its own method.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Base And Derived Class&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Inheritance is one of the fundamentals of Object Oriented Programming (OOP) along with &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-access-modifiers.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Encapsulation&lt;/a&gt;, &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-classes.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Abstraction&lt;/a&gt; and &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-polymorphism.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Polymorphism&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
As C# is a Object Oriented Programming Language so it supports Inheritance, Encapsulation, Abstraction and Polymorphism.&lt;/div&gt;
&lt;h4 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.4em; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Base Class&lt;/h4&gt;
&lt;table class=&quot;standard-desctn&quot; style=&quot;background-color: white; border-collapse: collapse; border: 1px solid rgb(212, 212, 212); color: black; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 10px 15px; padding: 0px; text-align: justify; width: 602px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 0px; margin: 0px 15px; padding: 10px 5px 10px 10px; width: 586px;&quot;&gt;The class whose properties and behaviors are being inherited.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h4 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.4em; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Derived Class&lt;/h4&gt;
&lt;table class=&quot;standard-desctn&quot; style=&quot;background-color: white; border-collapse: collapse; border: 1px solid rgb(212, 212, 212); color: black; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 10px 15px; padding: 0px; text-align: justify; width: 602px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 0px; margin: 0px 15px; padding: 10px 5px 10px 10px; width: 586px;&quot;&gt;The class which is inheriting the properties and behaviors of another class.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
As a standard, &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;derived&lt;/strong&gt; class should always be a specialization of the &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;base &lt;/strong&gt;class.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
If there is a base class called as &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;Person&lt;/i&gt; then there can be one derived class called as &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;Employee&lt;/i&gt;and another called as &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;Customer&lt;/i&gt;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
An &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;Employee &lt;/i&gt;is a &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;Person&lt;/i&gt; and a &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;Customer&lt;/i&gt; is also a &lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;Person&lt;/i&gt;. Hence, a derived class should always have an &amp;quot;is a&amp;quot; relationship with the base class.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Derived classes can use the members of the base class and can also add members of its own.&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-inheritance.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-inheritance.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-3752610121142615170</guid><pubDate>Fri, 16 May 2014 16:39:00 +0000</pubDate><atom:updated>2015-06-27T13:16:19.415-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Properties Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
In C#, properties are members of a &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-classes.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;class&lt;/a&gt; or &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-structs.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;struct&lt;/a&gt; that expose &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-access-modifiers.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;private fields&lt;/a&gt;. Hence, using properties values can be read from or assigned to private fields.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
In addition to class and structs, properties can also be part of an &lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-interfaces.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;interface&lt;/a&gt;. This is done using the auto-implemented properties.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Type of Properties in C#&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Properties use &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;accessors&lt;/strong&gt; to read or write data.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Based on the type of operations, properties can be divided into below categories:&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Read-only property&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Write-only property&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Read/Write property&lt;/li&gt;
&lt;/ul&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Read-only Property&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Read-only properties use the &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;get&lt;/strong&gt; accessor to read data from fields.&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    public class Employee
    {
        private string _language;

        public string Language
        {
            get
            {
                return _language;
            }
        }
    }&lt;/pre&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-properties.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-properties.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-3369443644599488051</guid><pubDate>Fri, 16 May 2014 16:39:00 +0000</pubDate><atom:updated>2015-06-27T13:16:08.969-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Access Modifiers Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Types and members in C# have certain accessibility level. This accessibility level is enforced by using the &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Access modifiers &lt;/strong&gt;(Also called as Access specifiers).&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Access modifiers decide whether a Type or a Member should be visible to other code from inside a assembly or from other assemblies.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Access Modifiers in C#&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Following Access modifiers are available in C#:&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;public&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;protected&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;internal&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;protected internal&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;private&lt;/li&gt;
&lt;/ul&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Public Access Modifier&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Types or type members having a &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;public&lt;/strong&gt; access modifier can be accessed by any program. There are no restrictions on accessing a public type or member.&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    public class Data
    {
        public int axisX;
        public int axisY;
    }

    static void Main(string[] args)
    {
        Data data = new Data();

        data.axisX = 100;
        data.axisY = 300;

        Console.WriteLine(&amp;quot;Axis X is {0} and Y is {1}&amp;quot;, data.axisX, data.axisY);

        Console.ReadLine();
    }
        &lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;span class=&quot;deepgreen&quot; style=&quot;color: #1c4f02; font-weight: 600; margin: 0px; padding: 0px;&quot;&gt;Axis X is 100 and Y is 200&lt;/span&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-access-modifiers.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-access-modifiers.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7606172489424649636.post-343760834564414759</guid><pubDate>Fri, 16 May 2014 16:39:00 +0000</pubDate><atom:updated>2015-06-27T13:15:58.035-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Tutorial</category><category domain="http://www.blogger.com/atom/ns#">csharptutorial</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>C# Namespaces Tutorial For Beginners With Examples</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Namespaces are used to group set of related types and hence helps in organizing the code.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Types with same names can exist within different namespaces to create globally unique types.&lt;/div&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Creating a Namespace&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
A namespace is created by using the keyword &lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;namespace&lt;/strong&gt; followed by the namespace name. Below example shows the usage of namespace in a C# program.&lt;/div&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #fafafa; border-color: rgb(242, 242, 242) rgb(242, 242, 242) rgb(242, 242, 242) rgb(66, 132, 176); border-style: solid; border-width: 1px 1px 1px 2px; font-family: &amp;#39;Lucida Console&amp;#39;, &amp;#39;courier new&amp;#39;, monospace; font-size: 12px; line-height: 1.5em; margin: 1px 15px; overflow: auto; padding: 0px;&quot;&gt;    namespace HelloWorld
    {  
        class Employee
        {           
            void Employee()
            {

            }
        }
    }
        &lt;/pre&gt;
&lt;hr style=&quot;background-color: #d4d4d4; border: 0px; clear: both; color: #d4d4d4; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; height: 1px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
&lt;h2 style=&quot;background-color: white; font-family: &amp;#39;Trebuchet MS&amp;#39;, Arial, sans-serif; font-size: 1.8em; font-weight: normal; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
Contents of a namespace&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 15px; padding: 0px; text-align: justify;&quot;&gt;
In C#, a namespace can have the following types within it:&lt;/div&gt;
&lt;ul class=&quot;mainpage&quot; style=&quot;background-color: white; color: #4284b0; font-family: Verdana, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 18.4320011138916px; margin: 10px 30px; padding: 0px 15px; text-align: justify;&quot;&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-classes.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Class&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-interfaces.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Interface&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-structs.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Struct&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-enum.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Enum&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-delegates.html&quot; style=&quot;background-color: inherit; border: none; color: #4284b0; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Delegate&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 0px; color: black; list-style: disc; margin: 5px 0px 5px 5px; min-height: 10px; padding: 0px 5px 2px 1px; text-align: justify;&quot;&gt;Another Namespace&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;a href=&quot;http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-namespaces.html#more&quot;&gt;Read more »&lt;/a&gt;</description><link>http://dotnetcsharptutorial.blogspot.com/2014/05/csharp-namespaces.html</link><author>noreply@blogger.com (Unknown)</author></item></channel></rss>