Monday, January 28, 2013

Send Email using ASP.NET C#

How to send email using asp.net
In this article I will explain how to send email using asp.net.

Description:

In realtime we will use gmail,yahoo,hotmail etc to send mails to particular user here I will show to how to implement mail sending concept in asp.net.

To implement mail concept in asp.net first we need to add following reference to our applicationSystem.Web.Mail namespace 

What is System.Web.Mail

System.Web.Mail is a namespace which contains classes that enable us to construct and send messages using the CDOSYS (Collaboration Data Objects for Windows 2000) message component. The mail message is delivered either through the SMTP mail service built into Microsoft Windows 2000 or through an arbitrary SMTP server.

How we can get this reference (System.Web.Mail

We need to add System.web.dll reference to our application for that follow below steps

a                 a)  On the Project menu, click Add Reference.
b)    On the .NET tab, locate System.Web.dll, and then click Select.
c)     Click OK in the Add References.

After that design your aspx page like this


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Send Mail using asp.net</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style=" border:1px solid" align="center">
<tr>
<td colspan="2" align="center">
<b>Send Mail using asp.net</b>
</td>
</tr>
<tr>
<td>
From:
</td>
<td>
<asp:TextBox ID="txtFrom" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Subject:
</td>
<td>
<asp:TextBox ID="txtSubject" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
To:
</td>
<td>
<asp:TextBox ID="txtTo" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td valign="top">
Body:
</td>
<td>
<asp:TextBox ID="txtBody" runat="server" TextMode="MultiLine" Columns="30" Rows="10" ></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnSubmit" Text="Send" runat="server" onclick="btnSubmit_Click" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Now add following namcespaces in your codebehind



using System.Web.Mail;
After that write the following code in button click



protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
MailMessage Msg = new MailMessage();
// Sender e-mail address.
Msg.From = txtFrom.Text;
// Recipient e-mail address.
Msg.To = txtTo.Text;
Msg.Subject = txtSubject.Text;
Msg.Body = txtBody.Text;
// your remote SMTP server IP.
SmtpMail.SmtpServer = "10.20.72.1";
SmtpMail.Send(Msg);
Msg = null;
Page.RegisterStartupScript("UserMsg""<script>alert('Mail sent thank you...');if(alert){ window.location='SendMail.aspx';}</script>");
}
catch (Exception ex)
{
Console.WriteLine("{0} Exception caught.", ex);
}
}
Here use your SMTP server address then only it will work for you and check mails in spam also because sometimes mails should be appear in spam folder also.



Demo





Website Navigation in ASP.NET

How to Navigate webpage in ASP.NET

When you have multiple pages in your application you can use simple website navigation features provided in ASP.NET. These features allow you to show an easy way to your user to navigate through website pages. Moreover, users can see path of the website, the current page where the user is standing at this time, the previous page from where the user came to this page and the root or home page of the website. So user can move easily between web pages of a website when website navigation is used. ASP.NET built-in site navigation features are really the simple way to deal with website navigation.   

Web.sitemap File

ASP.NET provides a consistent way of website navigation. It provides a file to store your page titles and links and you can bind this file to ASP.NET controls for website navigation. It is an XML file provided in ASP.NET with .sitemap extension. It organizes website pages links in a hierarchical navigational structure. There can be more than one sitemap files but commonly there is only one for a website. If there are more than one sitemap file for a website than the other sitemap files are referenced in a siteMapNode of a web.sitemap file. This file is located at the root of the website and always saved with Web.sitemap name. Web.sitemap file is always saved in XML formatting.

Navigation Controls

ASP.NET provides navigation controls for website navigation purposes.

Menu Control

Menu Control is used for both static and dynamic display of website menus. You can bind SiteMapDataSource to menu control to display navigational menu of the website. Menu control can be customized using template tags. Menu control provides great control to work with sitemap infrastructure.

Static and Dynamic Display
Static and dynamic display can be handled using StaticDisplayLevels and MaximumDynamicDisplayLevels properties of Menu control.

Appearance

Orientation property of Menu control is used to set the appearance vertical or horizontal.  You can also set dynamic appearance time by using DisappearAfter property.

TreeView Control
TreeView is the most popular control to display hierarchical data. It displays sitemap links of a website in a root-parent-leaf structure. TreeView nodes can be programmatically created or you can bind SiteMapDataSource or XMLDataSource to TreeView control. It can also be customized using template tags.

Root Node: A root node in TreeView control is the node that has no parent node and one or more child nodes.
Parent Node: A node should have one or more child nodes to become a parent node.
Leaf Node: Leaf node is a node that has no child node.

SiteMapPath Control
It represents the path of the navigation of your website. It shows the current location of the website and shows the links of the previous pages back to the home or root page. So SiteMapPath control navigates the user backwards and it doesn’t allow going forwards. You don’t have to bind data to SiteMapPath control; it obtains data directly from web.sitemap file and displays the titles of the pages. You can click on the title in SiteMapPath control to go to that page of the website.  Normally it works with other navigation controls but you can use it alone in your website.

  1. Create a new Empty Web Site in Visual Studio 2010 either in Visual Basic or Visual C#.
  2. Add a master page to the website.
  3. Add a Site Map file in the Web Site and write code below.
    <?xml version="1.0" encoding="utf-8" ?>
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
           <siteMapNode url="Home.aspx" title="Home" description="Home Page">
                  <siteMapNode url="About.aspx" title="About Us" description="">
                  </siteMapNode>
                  <siteMapNode url="Products.aspx" title="Our Products" description="All Products">
                         <siteMapNode url="ComputerProducts.aspx" title="Computer" description="Computer Products" />
                         <siteMapNode url="ElectronicsProducts.aspx" title="Electronics" description="Electronics" />
                  </siteMapNode>
                  <siteMapNode url="Customers.aspx" title="Our Customers" description="Customer List">
                         <siteMapNode url="AmericanCustomers.aspx" title="American Customers" description="American Customers List" />
                         <siteMapNode url="EuropeanCustomers.aspx" title="European Customers" description="European Customers List" />
                  </siteMapNode>
                  <siteMapNode url="Contact.aspx" title="Contact Us" description="">
                  </siteMapNode>
           </siteMapNode>
    </siteMap>
    Web.siteMap file has a root node with title “Home” and it has other nodes like “About Us”, “Products”, “Customers” and “Contact Us” as its child nodes. “Product” and “Customers” have their own child nodes so these are parent nodes. “About Us”, “Contact Us” are leaf nodes because these have no child nodes. 
     
  4. Add ten Web Forms in the Web Site and select master page. Rename the pages as we have mentioned in Web.sitemap file.
  5. Open master page and drag and drop a SiteMapDataSource, a SiteMapPath and a Menu.
  6. Configure SiteMapDataSource from little arrow at the top and choose SiteMapDataSource for TreeView
    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
    <asp:SiteMapPath ID="SiteMapPath1" runat="server">
    </asp:SiteMapPath>
    <br />
    <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1">
    </asp:Menu>

     
  7. Now you can view Web Site in browser.



Saturday, January 26, 2013

How to find UserName of Mobile Number

Trick To Find User Surname Of Any Reliance Mobile Number


reliance number
While searching on web for finding details of user of particular mobile number, I came across a website that can help you to get little information about that user. In this tutorial i will teach you to find surname of Reliance mobile number user in few simple steps. Basically this website is for recharge but it helps you to get information about user of that mobile number. So lets dive into it.


   1. Go to this  Website
   2. Enter Mobile Number in Reliance Subscriber Number.
   3. Email address is optional so you don't need to enter.
   4. Done!!!


How to boost internet speed

How to boost internet speed without any software


Increase internet speed by 20% without any software.  
Microsoft reserves 20% of your available bandwidth for their own purposes like Windows Updates and interrogating your PC etc. By unreserving this bandwidth, you can make your internet connection faster By 20%. The steps to do so are – 

1. Click Start then Run and type "gpedit.msc" without quotes.

2. Then go to Local Computer Policy>Computer Configuration>Administrative Templetes>Network>QoS Packet Scheduler. Click on QoS Packet Scheduler. In the right side , find Limit Reservable Bandwidth and double click on Limit Reservable Bandwidth.

3. It will say it is not configured but the truth is under the ‘Explain’ tab. Select ‘Enable’ and set reservable bandwidth to zero. 

4. Click on ‘Apply’ and your internet speed will boost up by 20%.




You might also Like:





Tips to clean touch screen device

Best tips to clean touch screen device


Nowadays touch screen devices are becoming popular among the youths.They don’t know the correct method to clean there touch screen devices.In this condition if a touch screen device is not cleaned properly than it will not work effectively.That is way we have to be more careful in cleaning a touch screen as compared to a normal screen.In this post I have explained some tips to clean touch screen of your device.


Use Microfiber cloth
Are you amazed after reading name of microfiber?There is no need to be amazed because it is that cloth which is used to clean spectacles.It contains good quality of fiber which don’t cause any harm to the touch screen while cleaning.It is easily available in the market.

Switch off your device
Before cleaning a touch screen device you must switch off it.If you clean your device when it is switched on then some commands may be activated automatically and it may damage the software.

Move cloth circularly
Never slide the cloth up and down on the screen.Alaways clean the screen by moving the cloth in circular shape.In this way the moisture on the screen will be also removed.

Don’t apply much pressure
Remember that don’t apply much presser on the screen while cleaning it.It may damage the screen,because as compared to TFT other screens are so much delicate.Some special liquids are also available in the market for cleaning touch screen,but you can also use distilled water.Don’t pour water on the screen directly,first pour water on the cloth and than clean the screen.



Best Android Games

5 Best Android Games To Be Played In 2012

5 Best Android Games To Be Played In 2012

When do you usually talk about games for mobile phones? Many mobile phone users like to play games in free time to relax their mind. As technology is developing, new games are being launched in the market. Games are getting most popular in the present generation. On seeing the growing popularity of games in the market, I’m listing some of the best Android games. A list of some best games for Android mobile phone users is given below.


1. Reckless Racing 2
It is a racing game. It is also a multi-player game. In the game, several levels are there. You have to race with computer opponents. If you win the first level, then you can go ahead to the next level. Several benefits are available. You can get them by winning. There are some levels that you have to unlock them to play by finishing the starting levels.

Different levels have medals like Bronze, Silver and Gold. There will be several curves and drifting. You have to take care while turning. Penalty lines are visible you should not cross them. In the game, by playing different levels you can gain money and also car can be modified.

2. Stay Alive
It is one of the most exciting games to be played. In this game, you have to kill your enemies by using weapons. Only few ammos will be provided, but you can collect them on the way. You have to defend yourself from asteroids and enemies. Like this, you have to cross each level by defeating them.

3. Farm Frenzy 3
It is a loveable game to play. The game is very simple. In the game, you have to buy the animals, after buying them, you have to feed them. Animals will be working for you, such as, sheep, chickens and cow. They will pick the goods and will be placing them in the safe place. They will also help you in business by giving eggs, milk and wool.

Predators will try to destroy your farm and animals. You have to quickly save them at that time. You can also keep up cats and dogs. Cats will also help in shifting the goods from one place to another place. Dogs will protect from predators. As you finish one level, you can earn stars and can unlock upgrades.

4. Great Little War Game: All Out War
Great little war game is full of tragedy game with 3D effects and graphic style in comedy. You have to command your army and guide them. The main target is to kill the enemies on land, sea and air. You should be able to attack them in any situation. Before going for war, you should think about your reinforcements. The path to go it may be through air or land or sea. You should be capable to capture the factory of enemies, after defeating everyone you will be the winner of the game.

5. SupaSupaCross
It is an interesting game to be played. You have to reach the finishing line to be the winner. There will be so many opponents with you. You must control the speed and take care of the path. There will be different levels, after finishing the one level you will enter into the next level.



You might also Like:





How to protect data by storing it online


How to protect your data by storing it online


If your hard drive crashes or your laptop is steeled by someone and if it contains any important data than you will loose it. But if you want than you can protect your data online. There are so many websites that allows you to store your data online. Some famous websites are listed below on which you can store your data and hence protect it from any damage.



Websites
Free Storage
Paid Storage
Mobile App
Desktop Client
URL
Adrive
50 GB
$14(100GB)
No
Win/mac/
linux
Badongo
Unlimited
-
Yes(IOS)
Win/mac
Box.com
5 to 50 GB
$15(500GB)
Yes(IOS/BB/And)
-
Dropbox
2 GB
$20(100GB)
Yes(IOS/BB/And)
Win/mac/
linux
Skydrive
25 GB
-
No
-
   



You might also Like:

Security apps for iphone

Top 10 security Apps iphone

This is an important issue to look out for your mobile’s security. You know that there are lots of new gadgets made and new inventions are going in the field of technology. The mobile market is developing every day with new mobiles and Smartphones. For this Smartphones there is a big issue of security and there is a possibility that the phone can be hacked and you will lose your valuable data. So you need to secure your device from the different malware attacks. For this type of issues there are lots of security apps which secure your device. It will lock all your files and folders with a password and does not allow the threats to come and attack your data.
clip_image002
Here are some of the security apps which can protect your data, files and your device from the dangerous malware attacks.
  1. Firewall IP: This application is the finest for the security of your mobile. It allows your device to block the UDP & TCP connections. It sets the different host name for your device connections. It also blocks the unwanted content and redesigns the popup. It can track the IP of unwanted network which stabs a connection with your iPhone.
  2. Cisco SIO To-Go: It is the global network and security manager which takes the responsibility of your mobile for external threats. This app is specially invented by CISCO to manage the security issues in iPhone. It protects your device and secures your files with new security signatures and different codes.
  3. Folder Lock: This application is the finest and also the user-friendly for your device. It will protect your files and folders by aligning the PIN or Passwords to the files and folders. It is a best for the files that contain the important data and blocks the encrypted and corrupt files which harm your device.
  4. Mobile Active Defence: This application is also the suited app for iPhone which protects the data before it lost from your device. It is meant to be the enterprise for the dangerous security issues. If your device is attacked by a virus then it locks all the files and folders which contain data.
  5. 1 Password: The name itself states that it gives the passwords to all the desired files and protects your files. It also stores the passwords in a secret folder. It will secure all your important information and synchronises your device with the help of Wi-Fi. It has two layer defence of unlock codes and provides master password for security.
  6. iCam Viewer: This is a must application and it can have free for your essential files and data. You can say that it is a free video scrutiny mobile app which acts like a CCTV camera for your device. You can protect your device and can take pictures of surveillance then can save to your libraries.
  7. Splash ID: This is the application which provides your files and folders with the passwords. It protects all your data and delivers the full security for your device from external threats. You can say this app acts like a password manager which works with the tools and it is compatible with Mac and PC’s.
  8. Spam Arrest: This application blocks the malware which is attacking your device and destroys all the threats. It provides the protection to your inbox as you receive the spam mails or multimedia messages. It arrests the virus and deletes it before it enters the junction. It provides full security for your device.
  9. Snap: This is the finest app which allows you to set the passwords for the file manager as you have all the data stored in it. It protects all your important data and keeps the password in a secret folder and display when you forget or demand the password. It guides you to allow the files which you received from other sources.
  10. iDiscrete: This is a special application which forms all the security platelets to block the malware from attacking your device. It sets the passwords for your files and folders and keeps them isolated from the external attacks. It secures the file manager where you find all your photos and videos.
The above apps are the finest apps which provide the total security for your iPhone and blocks all the external threats and malware from attacking your iPhone. If you are running through financial crises and need instant cash, opt for same day cash loans .This loan can be repaid when you receive your next pay cheque.