Posts

Showing posts from November, 2013

Get IP address and Host Name of Local Computer

In the Blog of MSDN i found and article to get host and IP address of computer I wrote a code to get it and it gives both address of IPV6 and IPV4 and we know that there is an array of type IPAddress  . and with the help of foreach it will give all address of computer and if you have virtual machine installed then it will also give IP address of this also. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; namespace Networking {     class Program     {         static void Main( string [] args)         {             Program .gethostname();         }         public static void gethostname()         {             string hostname = Dns .GetHostName();                         IPAddress [] ipaddress = Dns .GetHostAddresses(hostname);             foreach ( IPAddress x in ipaddress)             {                 Console .Write(" this is computer name: " + hostname + " and IP address is

Send Email Through GoDaddy Server to other Email Account in Asp.net

Image
Suppose in your website you have a contact us or career page in which user may send his data or can contact you and you want that data on y our Gmail, Outlook, Hotmail or other email account. First of all look at the form In the above form if you want to receive user data on you different email accounts then one thing you should consider in your mind.  Web browser is not going to directly send data in your email account (email will be send through other email account) , So you will have to give an interface through which your server can send data from client side. So how you will do it in Asp.net ? for this you will have to go through following steps. 1. add name space                          using System.Net;                          using System.Net.Mail; 2. On click event of submit button write following code.  1. Create an object of MailMessage class like this          MailMessage msg = new MailMessage ();  in this object you will get many properties and method

Online Text Editor in Javascript

Image
here I have pic of my simply created online text editor, actually I was working on a project and it needs a form that also can edit text like making it Bold, Italic, underline and many things. So, In this smallest project I took Text area HTML DOM and few buttons as it is obvious in the above pic. When person on client side starts writing then simply he or she may need to decorate his or her writing since in database as we know that it will simply store like ordinary data and when we retrieve it it simply display it in string format. To make it decor able after saving we will have to add html tags like </br> to break line and <b></b> to make text bold. java script function code  function editor(domofhtml) {             var Field = document.getElementById('TextArea1');             var val = Field.value;             var selected_txt = val.substring(Field.selectionStart, Field.selectionEnd);             var before_txt = val.substring(0, Field.selectionSt

A Route Named 'something' Could Not Be Found in The Route Collection

This type of problem is really painful while writing code for URL Rewriting, I searched a lot on internet but could not found proper solution so i relinquished this idea but one day I was trying to rewrite URL again and suddenly got the solution for this problem. you should not worry some much about this simply upload global.asax file in root directory and this will solve your all such problem. thank you for reading this.