The main purpose of "Dot Net Labs" provide the dot net program. You can learn dot net, .Net Core, C#, SQL, Linq step-by-step.

Monday 5 June 2017

How To Add Contact Form (Contact Us Page) in Blogger


Having a contact page on your blog is highly important. It is how visitors, brands and companies can reach you and it's something that every bloger should have. If sharing your email address on your blog is not your cup of tea, a contact form can serve as an easy way for others to get in tough. You can copy below code and paste there you want.

<div><div style="float:left">
<script>
var blogId = '<Enter your blogid>';//this number should be mandatorily edited.
//The below message 5 Strings can also be edited
var contactFormMessageSendingMsg ='Sending...';
var contactFormMessageSentMsg = 'Your message has been sent.';
var contactFormMessageNotSentMsg = 'Message could not be sent. Please try again later.';
var contactFormEmptyMessageMsg ='Message field cannot be empty.';
var contactFormInvalidEmailMsg = 'A valid email is required.'

var widgetLoaded=false;
function sendEmailMsg() {
if(widgetLoaded== false) {
_WidgetManager._RegisterWidget('_ContactFormView', new _WidgetInfo('ContactForm1', 'sidebar', null, document.getElementById('ContactForm1'), {'contactFormMessageSendingMsg': contactFormMessageSendingMsg , 'contactFormMessageSentMsg': contactFormMessageSentMsg , 'contactFormMessageNotSentMsg': contactFormMessageNotSentMsg , 'contactFormInvalidEmailMsg': contactFormInvalidEmailMsg , 'contactFormEmptyMessageMsg': contactFormEmptyMessageMsg , 'title': 'Contact Form', 'blogId': blogId, 'contactFormNameMsg': 'Name', 'contactFormEmailMsg': 'Email', 'contactFormMessageMsg': 'Message', 'contactFormSendMsg': 'Send', 'submitUrl': 'https://www.blogger.com/contact-form.do'}, 'displayModeFull'));
widgetLoaded=true;
document.getElementById('ContactForm1_contact-form-submit').click();
}
return true;
}
</script>
<form name='contact-form'>
<div>Your Name : </div>
<input class='contact-form-name' id='ContactForm1_contact-form-name' name='name' size='30' type='text' value=''/>
<div>Your Email: <em>(required)</em></div>
<input class='contact-form-email' id='ContactForm1_contact-form-email' name='email' size='30' type='text' value=''/>
<div>Your Message: <em>(required)</em></div>
<textarea class='contact-form-email-message' id='ContactForm1_contact-form-email-message' name='email-message' rows='5'></textarea>
<p></p>
<input class='contact-form-button contact-form-button-submit' id='ContactForm1_contact-form-submit' type='button' value='Send' onclick="sendEmailMsg()"/>
<div style='text-align: center; max-width: 450px; width: 100%'>
<p class='contact-form-error-message' id='ContactForm1_contact-form-error-message'></p>
<p class='contact-form-success-message' id='ContactForm1_contact-form-success-message'></p>
</div>
</form>
</div>
<div style="text-align:center"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn5Dn-qCbIqT949GcJ4eA-WRPenLjN5Yl1o8TD95fi1YMQjr5T-FBUIOKVe-7H4rZc7z1YADsV8nqgP_1_RZY8CdpbcZMRqz6vgpfRtNJfea2akXZfRDo16bxsTRFRyXktXGmcSY8Wu1k/s1600/noticeboard_savemoneyindia.jpg" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn5Dn-qCbIqT949GcJ4eA-WRPenLjN5Yl1o8TD95fi1YMQjr5T-FBUIOKVe-7H4rZc7z1YADsV8nqgP_1_RZY8CdpbcZMRqz6vgpfRtNJfea2akXZfRDo16bxsTRFRyXktXGmcSY8Wu1k/s320/noticeboard_savemoneyindia.jpg" width="320" height="201" data-original-width="310" data-original-height="195" /></a>
</div>
</div>

Thursday 16 February 2017

What is C#?


  • C# is an Object Oriented  Programming Language (OOP). The common traits are encapsulation, inheritance and polymorphic.
  • All the C# files are saved with file extension .CS
  • C# includes the following five types of tokens.
      • Keywords
      • Identifies
      • Literals
      • Identifies
      • Operators
      • Punctuates
  • Programming Language is a process of creating computer programs or in the other word software to solve a particular problem.
  • C# is developed by Microsoft Corporation in year 2000.
  • C# is the part of  .Net Framework and currently in version 6.0.
  • C# can be used to build variety of applications. There are following example of applications developed by c#.
      • Window Application using WinForm Or WPF
      • Mobile Application for Phones such as Nokia Lumia (Native support) But you can use a 3rd party library called "Xamarin" to create mobile application for Android and IOS as well.
      • Web Application using Asp.net web forms or asp.net MVC.

As per the interview perspective this is question is very important so please try to learn in-depth for good impression.

What is C# and latest version of C#?

What is C#?
C# stands out as a powerful and versatile language. It is a modern, object-oriented programming language that was introduced by Microsoft in the early 2000s, C# provides a flexible and efficient platform for building a wide range of applications, from desktop software to web applications and even mobile apps. C# is specifically designed to run on the .NET Framework, which provides a comprehensive set of libraries and tools for developing applications on the Windows platform.

Key Features of C#:
1. Object-Oriented Approach: C# follows the principles of object-oriented programming (OOP), enabling developers to create reusable and modular code through the use of classes, objects, inheritance, and polymorphism.

Type Safety: C# is a statically-typed language, which means that all variables and expressions must have a specific data type defined at compile-time. This ensures type safety and helps catch errors early in the development process.

Memory Management: C# utilizes automatic memory management through a process known as garbage collection. This feature helps simplify memory management tasks by automatically clearing memory that is no longer in use, reducing the risk of memory leaks and improving application performance.

Language Interoperability: C# is designed to be language interoperable, allowing developers to integrate code written in different languages such as Visual Basic .NET and C++ into the same application. This interoperability enhances code reusability and promotes collaboration among developers.

Exception Handling: C# provides robust support for handling exceptions, allowing developers to catch and handle errors gracefully during the execution of their programs. This helps improve the reliability and stability of applications, making them more resilient to unexpected issues.

Latest Version of C#:
The latest stable version of C# is C# 10, which was released along with .NET 6.0 in November 2022. You can use its feature with the .Net 7 SDK.

Note: C# 12 features have been introduced in previews.




Tuesday 17 January 2017

Increment ++ and Decrement -- Operator as Prefix and Postfix


In this article we will explain Increment ++ and Decrement -- Operator as Prefix and Postfix

Here number1 is variable. number1++ and ++number1 (postfix and prefix) 

number1++ : first assign then increment

Example 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            
            int number1,number2;
           
            number1 = 10;
           
            number2 = number1++;

            Console.WriteLine(number2); 
           
            Console.WriteLine(number1);

            Console.ReadKey();
           
        }
    }
}


Output : 
10
11

++number1 : first increment then assign

Example 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            
            int number1,number2;
           
            number1 = 10;
           
            number2 = ++number1;

            Console.WriteLine(number2); 
           
            Console.WriteLine(number1);

            Console.ReadKey();
           
        }
    }
}

Output : 
10
11


-- number1 : first Decrement then assign

Example 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
           
            int number1,number2;
           
            number1 = 10;
           
            number2 = --number1;

            Console.WriteLine(number2); 
           
            Console.WriteLine(number1);

            Console.ReadKey();
           
        }
    }
}

Output : 
9
9


 number1-- : first assign then Decrement 

Example 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
           
            int number1,number2;
           
            number1 = 10;
           
            number2 = number1--;

            Console.WriteLine(number2); 
           
            Console.WriteLine(number1);

            Console.ReadKey();
           
        }
    }
}

Output : 
10
9







Modulus Operator in C#


In this article we will explain how to use ( % ) Modulus Operator in C#. Modulus find the remainder.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int number1, number2, results;
            //Size of int : Signed 32-bit integer, accept numerical values
            number1 = 10;
            number2 = 5;
            results = number1 % number2;
            Console.Write("Your Results is : "+results);
            //Writes the line
            //results is a local variable which type of integer
            Console.ReadKey();
            // Console.ReadKey is method and we can use Console.ReadKey method for reading purpose
            // Press key and back to console window
        }
    }
}

The output is :

Your Results is : 2







Divided Operator in C#


In this article we will explain how to use ( / ) Divided Operator in C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int number1, number2, results;
            //Size of int : Signed 32-bit integer, accept numerical values
            number1 = 10;
            number2 = 5;
            results = number1 / number2;
            Console.Write("Your Results is : "+results);
            //Writes the line
            //results is a local variable which type of integer
            Console.ReadKey();
            // Console.ReadKey is method and we can use Console.ReadKey method for reading purpose
            // Press key and back to console window
        }
    }
}

The output is :

Your Results is : 2





Multiplication Operator in C#


In this article we will explain how to use ( * ) Multiplication Operator in C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int number1, number2, results;
            //Size of int : Signed 32-bit integer, accept numerical values
            number1 = 5;
            number2 = 10;
            results = number1 * number2;
            Console.Write("Your Results is : "+results);
            //Writes the line
            //results is a local variable which type of integer
            Console.ReadKey();
            // Console.ReadKey is method and we can use Console.ReadKey method for reading purpose
            // Press key and back to console window
        }
    }
}

The output is :

Your Results is : 50







Subtraction Operator in C#


In this article we will explain how to use ( - ) Subtraction Operator in C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int number1, number2, results;
            //Size of int : Signed 32-bit integer, accept numerical values
            number1 = 10;
            number2 = 5;
            results = number1 - number2;
            Console.Write("Your Results is : "+results);
            //Writes the line
            //results is a local variable which type of integer
            Console.ReadKey();
            // Console.ReadKey is method and we can use Console.ReadKey method for reading purpose
            // Press key and back to console window
        }
    }
}

The output is :

Your Results is : 5







Addition Operator in C#


In this article we will explain how to use ( + ) Addition Operator in C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int number1, number2, results;
            //Size of int : Signed 32-bit integer, accept numerical values
            number1 = 5;
            number2 = 10;
            results = number1 + number2;
            Console.Write("Your Results is : "+results);
            //Writes the line
            //results is a local variable which type of integer
            Console.ReadKey();
            // Console.ReadKey is method and we can use Console.ReadKey method for reading purpose
            // Press key and back to console window
        }
    }
}

The output is :

Your Results is : 15






Popular Posts