Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Wednesday, 27 January 2016

How to find the IP Address of user machine using CMD

Today in Engineer's World, we are discussing a topic of Computer and Network in very easy way. Posted By- +Manish Kumar Gautam +LIVE VIAR +ASP.NET SOLUTIONS 

Click imagination hunt to see latest Blogs


Finding PC IP Address using CMD (Command Prompt) with two simplest methods

In general, we can find our IP Address by our CMD (i.e. Command Line/Prompt) Tool. This blog is all about finding IP Address in very easy way.

There are two commands by which you can able to see your Network Details like Host Name, IP Address, Gateway and many more.

Command-1: [ipconfig] -> this is the basic command by which you can able to see your network basic information like IP Address, Mask, and Gateway.
 
Command Name- ipconfig

Command-2: [ipconfig/all] -> by, this command you can see your entire network adapter and its related information include IP Address, Subnet Mask, Gateway, DHCP, DNS, MAC Address and many more.

Command Name- ipconfig/all

How to open CMD Tool?


Method 1

Step-1: Press Windows Key + R. It will open the Run Dialog Box.
Step-2: Type -> cmd. And click on “OK” Button. A Dialog box will appear automatically. This is your CMD (i.e. Command Line/Prompt Tool).
Step-3: Now, enter both the command (ipconfig and ipconfig/all) one by one.

Method 2 (For Windows 8, 8.1 and 10)

Step-1: Press Windows Key. Write cmd. You will see the Command Prompt Icon.
Step-2: Click the Command Prompt Icon.
Step-3: A Dialog box will appear automatically. This is your CMD (i.e. Command Line/Prompt Tool).


For any query, comment us below.


Related Questions: -


Q-1 What is ipconfig?
Ans. ipconfig means Internet Protocol Configuration, is a console application command that displays all TCP/IP network information in Windows.

Q-2 Usages of ipconfig?
Ans. ipconfig is used to display network information include IP Address, Subnet Mask, Gateway, DNS (Data Name Server), and customize DHCP (Dynamic Host Configuration Protocol) and DNS Settings.

Click imagination hunt to see latest Blogs

Keep learning and sharing…
Read More »

Monday, 18 January 2016

SIMILARITY AND DIFFERENCE BETWEEN LABEL AND LITERAL CONTROL

Today in Engineer's World, we are discussing a topic of C# in very easy way. Posted By- +Manish Kumar Gautam +LIVE VIAR  +ASP.NET SOLUTIONS

Click imagination hunt to see latest Blogs


SIMILARITY AND DIFFERENCE BETWEEN LABEL AND LITERAL CONTROL
  
D5. To encode text in Label control use Server.HtmlEncode() but in Literal use the mode property.
For ex- 

Practical Implementation: -

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Literal_control.aspx.cs"
    Inherits="Literal_control" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <%-- Server.Encode is used to encode string in Label control --%>
        <asp:Label ID="Label1" runat="server">
        <%=Server.HtmlEncode("<script>alert('Label Encode: Danger in code')</script>") %>
        </asp:Label>
        <br />
        <br />
        <%-- mode = Encode is used to encode string in Literal control --%>
        <asp:Literal ID="Literal1" runat="server" Mode="Encode" Text="<script>alert('Danger in code')</script>">
        </asp:Literal>
    </div>
    </form>
</body>
</html>

D6. The hierarchy of both controls is also a little bit different.

Label
Literal
(i) System.Object
(i) System.Object
(ii) Control
(ii) Control
(iii) WebControl
(iii) Literal
(iv) Label


Click imagination hunt to see latest Blogs

For ex-
You can check the flow of control as
Step-1 Go to the code behind of WebForm.
Step-2 In the page load write Label.

Practical Implementation: -

using System;
using System.Web.UI.WebControls;

public partial class Literal_control : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Label Label2 = new Label();
        Literal Literal2 = new Literal();
    }

  
Step-3 Right-click on the Label and Go to Definition. You can see the Label is inheriting from the WebControl.
Step-4 If you Right-click the WebControl you can see that it is inheriting from Control.
Step-5 If you Right-click the Control you can see that it is inheriting from the various thing which is directly or indirectly part of System.Object.

For any query, comment us below.

 
Related Questions: -


Q-1 How can a Label control differ than a Literal control?
Ans- Label control's final HTML code has an <span>…</span> HTML tag whereas, Literal control's final HTML code contains only text, which is not surrounded by any HTML tag.

Click imagination hunt to see latest Blogs

Keep learning and sharing...
Read More »

Friday, 15 January 2016

SIMILARITY AND DIFFERENCE BETWEEN LABEL AND LITERAL CONTROL

Today in Engineer's World, we are discussing a topic of C# in very easy way. Posted By- +Manish Kumar Gautam +LIVE VIAR  +ASP.NET SOLUTIONS

Click imagination hunt to see latest Blogs


SIMILARITY AND DIFFERENCE BETWEEN LABEL AND LITERAL CONTROL

Similarity(S) between Label and Literal Control

S1. Label and Literal both control used to show text.
S2. Both are server control.
S3. Both controls having Text property.

Difference(D) between Label and Literal Control

D1. Label control is surrounded by span tag whereas Literal control is directly written as it is. You can check on the “view page source” of the browser.
For ex-
On the designer page, you write the code as

Practical Implementation: -

<asp:Label ID="Label1" runat="server" Text="Label Control"></asp:Label>
<br />
<br />
<asp:Literal ID="Literal1" runat="server" Text="Literal Control"></asp:Literal>

But, in page source of browser, you got the code as

<span id="Label1">Label Control</span>
<br />
<br />
Literal Control

D2. Literal control is much lighter than Label control. As seen above.

D3. We can apply styling to Label control. Like changing its font to bold and color to red and backcolor to yellow. But there is no such styling property in Literal property. For Literal, we have to do the styling in code behind file like.
For ex-

Practical Implementation: -

//Applying style on Label Control
Label1.Text = "Label Control";
Label1.ForeColor = System.Drawing.Color.Yellow;
Label1.BackColor = System.Drawing.Color.Orange;
Label1.Font.Bold = true;

//Applying style on Literal Control
Literal1.Text = "<b><font color=\"Red\">Literal control</font></b>";

D4. We follow the basic HTML in a Literal control.
NOTE: To use double inverted comma, we use this \".

For any query, comment us below.


Related Questions: -


Q-1 Match the following?

a) Literal Control ----------------- i. SingleLine, MultiLine, Password
b) Label Control ------------------ ii. CommandName
c) TextBox Control -------------- iii. Convert to span tag in HTML
d) Button Control ---------------- iv. PassThrough, Encode, Transform mode

(A) a-iv, b-iii, c-ii, d-i
(B) a-ii, b-iv, c-i, d-iii
(C) a-ii, b-i, c-iii, d-iv
(D) a-iv, b-iii, c-i, d-ii
Ans- Option(D) a-iv, b-iii, c-i, d-ii

Click imagination hunt to see latest Blogs

Keep learning and sharing...
Read More »

Featured post

Think that makes you rich and richer

 Napolean said: “You can think and grow rich, but if you can be brought up like most people with work and you won't starve, this wil...