Friday 6 March 2015

Forgot Password By Email Page Code In Asp.Net

Posted by with No comments
http://csharpdotnetfreak.blogspot.com/2012/06/aspnet-forgot-password-email-page-code.html

 HTML SOURCE OF FORGOT PASSWORD PAGE


   1:  <form id="Form1" runat="server">
   2:  <div>
   3:  <fieldset>
   4:  <legend>Forgot Password</legend> 
   5:  <asp:Label ID="lblEmail" runat="server" Text="Email Address: "/>
   6:  <asp:TextBox ID="txtEmail" runat="server"/>
   7:   
   8:  <asp:RequiredFieldValidator ID="RV1" runat="server" 
   9:                              ControlToValidate="txtEmail" 
  10:                              ErrorMessage="Please Enter EmailID" 
  11:                              SetFocusOnError="True">*
  12:  </asp:RequiredFieldValidator>
  13:   
  14:  <asp:Button ID="btnPass" runat="server" Text="Submit" 
  15:                           onclick="btnPass_Click"/>
  16:   
  17:  <asp:ValidationSummary ID="ValidationSummary1" 
  18:                         runat="server" CssClass="error"/>
  19:                         
  20:  <asp:Label ID="lblMessage" runat="server" Text=""/>
  21:  </fieldset>
  22:  </div>
  23:  </form>

C# CODE
using System;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
using System.Net.Mail;

protected void btnPass_Click(object sender, EventArgs e)
    {
        //Create Connection String And SQL Statement
        string strConnection = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        string strSelect = "SELECT UserName,Password FROM Users WHERE Email = @Email";

        SqlConnection connection = new SqlConnection(strConnection);
        SqlCommand command = new SqlCommand();
        command.Connection = connection;
        command.CommandType = CommandType.Text;
        command.CommandText = strSelect;

        SqlParameter email = new SqlParameter("@Email", SqlDbType.VarChar, 50);
        email.Value = txtEmail.Text.Trim().ToString();
        command.Parameters.Add(email);

        //Create Dataset to store results and DataAdapter to fill Dataset 
        DataSet dsPwd = new DataSet();
        SqlDataAdapter dAdapter = new SqlDataAdapter(command);
        connection.Open();
        dAdapter.Fill(dsPwd);
        connection.Close();
        if(dsPwd.Tables[0].Rows.Count > 0 )
        {
            MailMessage loginInfo = new MailMessage();
            loginInfo.To.Add(txtEmail.Text.ToString());
            loginInfo.From = new MailAddress("YourID@gmail.com");
            loginInfo.Subject = "Forgot Password Information";

            loginInfo.Body = "Username: " + dsPwd.Tables[0].Rows[0]["UserName"] + "<br><br>Password: " + dsPwd.Tables[0].Rows[0]["Password"] + "<br><br>";
            loginInfo.IsBodyHtml = true;
            SmtpClient smtp = new SmtpClient();
            smtp.Host = "smtp.gmail.com"; 
            smtp.Port = 587;
            smtp.EnableSsl = true;
            smtp.Credentials = new System.Net.NetworkCredential("YourGmailID@gmail.com", "YourGmailPassword");
            smtp.Send(loginInfo);
            lblMessage.Text = "Password is sent to you email id,you can now <a href="Login.aspx">Login</a>";
        }
        else
        {
            lblMessage.Text = "Email Address Not Registered";
        }
        
    }
VB.NET
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Data
Imports System.Net.Mail

Protected Sub btnPass_Click(sender As Object, e As EventArgs)
  'Create Connection String And SQL Statement
  Dim strConnection As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
  Dim strSelect As String = "SELECT UserName,Password FROM Users WHERE Email = @Email"

  Dim connection As New SqlConnection(strConnection)
  Dim command As New SqlCommand()
  command.Connection = connection
  command.CommandType = CommandType.Text
  command.CommandText = strSelect

  Dim email As New SqlParameter("@Email", SqlDbType.VarChar, 50)
  email.Value = txtEmail.Text.Trim().ToString()
  command.Parameters.Add(email)

  'Create Dataset to store results and DataAdapter to fill Dataset 
  Dim dsPwd As New DataSet()
  Dim dAdapter As New SqlDataAdapter(command)
  connection.Open()
  dAdapter.Fill(dsPwd)
  connection.Close()
  If dsPwd.Tables(0).Rows.Count > 0 Then
   Dim loginInfo As New MailMessage()
   loginInfo.[To].Add(txtEmail.Text.ToString())
   loginInfo.From = New MailAddress("YourID@gmail.com")
   loginInfo.Subject = "Forgot Password Information"

   loginInfo.Body = "Username: " & Convert.ToString(dsPwd.Tables(0).Rows(0)("UserName")) & "<br><br>Password: " & Convert.ToString(dsPwd.Tables(0).Rows(0)("Password")) & "<br><br>"
   loginInfo.IsBodyHtml = True
   Dim smtp As New SmtpClient()
   smtp.Host = "smtp.gmail.com"
   smtp.Port = 587
   smtp.EnableSsl = True
   smtp.Credentials = New System.Net.NetworkCredential("YourGmailID@gmail.com", "YourGmailPassword")
   smtp.Send(loginInfo)
   lblMessage.Text = "Password is sent to you email id,you can now <a href="Login.aspx">Login</a>"
  Else
   lblMessage.Text = "Email Address Not Registered"
  End If

End Sub
Download Source Code

Thursday 5 March 2015

Glowing Blue Input Highlights Apply Textbox Glow Effect.

Posted by with No comments
input[type=text], textarea { -webkit-transition: all 0.30s ease-in-out; -moz-transition: all 0.30s ease-in-out; -ms-transition: all 0.30s ease-in-out; -o-transition: all 0.30s ease-in-out; outline: none; padding: 3px 0px 3px 3px; margin: 5px 1px 3px 0px; border: 1px solid #DDDDDD; } input[type=text]:focus, textarea:focus { box-shadow: 0 0 5px rgba(81, 203, 238, 1); padding: 3px 0px 3px 3px; margin: 5px 1px 3px 0px; border: 1px solid rgba(81, 203, 238, 1); }

Wednesday 25 February 2015

Problem saving changes in database table Microsoft Visual Studio 2010

Posted by with No comments
ERROR :
“You cannot save changes that would result in one or more error tables being re-created.You can override this behavior by changing your configuration options…” shown in figure 1
 (figure 1)
SOLUTION TO THIS PROBLEM :
Disable “Prevent saving changes that require the table re-creation” 
Step by step guide :
1. Click on Tools menu and then click on Options shown in figure 2

(figure 2)
2. Once you are in the Options menu , click on Database Tools , click on Tables and Database Designers and then untick Prevent saving changes that require table re-creation shown in figure 3

Sunday 8 February 2015

Easy Steps to Use Laptop as Wi-Fi Hotspot

Posted by with No comments

Easy Steps to Use Windows 8 Laptop as Wi-Fi Hotspot


There are 3 ways to flip your laptop equipped with Microsoft Windows 8 into a Wi-Fi hotspot. One amongst them needs that you just dig into the command prompt, a task several feel unwilling or unprepared to handle.
Easy Steps to Use Windows 8 Laptop as Wi-Fi Hotspot (1)
Here’s what you’ve have to do, based on Easy Steps to Use Windows 8 Laptop as Wi-Fi Hotspot.
Things that you may ought to share your net with different Wi-Fi Devices:
a) A working net connection
b) An in-built or External WiFi adapter that supports the sharing ability for net connection
c) A laptop

Finding out: that whether or not your Wi-Fi card

supports sharing

Let’s conclude that whether or not your WiFi card supports sharing or not for this head to search and open up CMD within the administrator mod. For gap CMD in administrator mode you would like to right click it so open the cmd in “Administrator Mode“.
After you have got opened cmd write the subsequent command and appearance for the factor mentioned within the screen shot that whether or not it’s written affirmative or no. It it’s affirmative then you can prolong “It means you can alter the hotspot and might share your net connection.”

Command to envision Sharing Compatibility of WiFi network for windows 8

Easy Steps to Use Windows 8 Laptop as Wi-Fi Hotspot (1)
Command: netsh wlan show drivers
Check sharing ability of the WiFi card

Creating The Wi-Fi Hotspot

Don’t shut the cmd as you are planning to use cmd once more. Following is that the program line to make the hotspot, set the password and name it as you would like too.
Easy Steps to Use Windows 8 Laptop as Wi-Fi Hotspot (2)
netsh wlan set hostednetwork mode=allow ssid=mywifi key=abcd
The higher than is that the command to make the hotspot. Replace “mywifi” with the specified network name and replace “abcd” with the specified arcanum which is able to be utilized by the others to attach to the hotspot.

Creating the hotspot in windows 8

Press the enter and hotspot will be created.

Starting the Wi-Fi Created Hotspot in Windows 8

Now you would like to begin the hotspot, once more you are require the cmd and also the cmd should run within the administrator mode. Write the subsequent command within the cmd to begin the higher than created hotspot.
Command: netsh wlan begin hostednetwork
Easy Steps to Use Windows 8 Laptop as Wi-Fi Hotspot (2)

Enabling WiFi hotspot in windows 8

Press enter and also the hotspot are created and can be ascertainable by the opposite devices similarly.

Sharing the operating net reference to the windows

eight Wi-Fi hotspot

All Right, everything has been done and currently you simply ought to offer your laptop’s net connection’s access to the created hotspot, so any user connected to the hotspot can have the net access additionally. For this reason you may ought to open the windows networking and sharing center.

Windows 8 searching the network and sharing center

Easy Steps to Use Windows 8 Laptop as Wi-Fi Hotspot (3)
Open up the network and sharing center, so head to “Change adapter settings” on the highest left pane. Click that to open. Here you may see your created hotspot affiliation and the affiliation that you would like to be shared with the hotspot for the net sharing. The created hotspot affiliation has the star with the name. You would like to open the properties of the affiliation that you would like to be shared with the hotspot.

Networking adapters windows 8

Easy Steps to Use Windows 8 Laptop as Wi-Fi Hotspot (3)
Right click and open the properties of the affiliation that has {the net|the web|the net} access and is that the original internet affiliation of the laptop computer, whether or not it’s a dialup, native space network or something like that. Head to the sharing tab within the properties so tick the “Allow different network users to attach through this computer’s internet connection” and within the drop below, choose the hotspot affiliation that is “Local space affiliation *21”, so hit ok. Re-dial the affiliation as an alternative reconnect the net affiliation if required.

Sharing net reference to hotspot

That was it and you are done, the password to attach with the hotspot is that the same that you used whereas fixing hotspot in the cmd. If you can’t still share the net then reason are that firewall or an antivirus is inflicting the matter, attempt disabling the firewall if you trust the person with whom you are sharing the hotspot.
Using these Easy Steps to Use Windows 8 Laptop as Wi-Fi Hotspot you can use WiFi connection on any device like tablet or your mobile phone.

http://www.thegeekyglobe.com/easy-steps-to-use-windows-8-laptop-as-wi-fi-hotspot.html

Saturday 7 February 2015

Free Website Malware and Security Scanner

Posted by with No comments

Free Website Malware and Security Scanner


  • http://sitecheck.sucuri.net/
  • http://www.quttera.com/website-malware-scanner

Coming Soon Templates

Posted by with 1 comment
http://www.freshdesignweb.com/free-coming-soon-templates.html

Creating an Under Construction or Coming Soon page in Magento

Posted by with 3 comments
When building a website, you may not want random visitors snooping your pages until you are ready for them. Even while some programs allow you to build your site on your local computer and then publish when you are finished, you still may want to test your site on the live server before opening to the public. In this case, you may want to place an "Under Construction" or "Coming Soon" page in place.
The problem lies with how your hosting server looks for the first page of your site, also called the index page. The server looks for pages that are named index.htm, index.html, index.php, and default.htm, in that order. If it finds a file with one of those names, it places that as the landing page of your website. Website design programs most often create an index.html or index.php page. When publishing your site, even for testing, it is likely that the first page will begin to display to the public. This article will guide you on how to create and set up a placeholder page so that you can work on your site in the background.

How to create a custom Under Construction/Coming Soon page

  1. Log into cPanel.
  2. Enter the File Manager. Be sure to navigate to the root folder for the domain you are working with. If it is the primary domain, use public_html.
  3. Click on New File, an icon found in the toolbar at the top of the page.
  4. Next, give the file a name. Our example will be named comingsoon.html. Click on the Create New File button to complete its creation. Note this simply creates an empty file.
    create and name the file
  5. Now we need to edit the empty file. Highlight the filename and then click on HTML Editor. This allows you to create the page visually, no coding needed. You can make it as fancy or simple as you wish. In our example we will make it very simple.
    add page content
  6. Once you have designed your page, click on the Save button in the upper left of the tool bar. It appears as a floppy disk.
  7. Now that you have created the page, you need to set the filen ame as your default for your website. Those instructions are found in our article on How to change your default index page in .htaccess. Below is a screenshot of how the page will display on the web once that is completed.
    coming soon page in place 

Source  : http://www.inmotionhosting.com/support/edu/cpanel/cpanel-file-manager/coming-soon-page


OR


Step 1 - Create an under Construction HTML page

Create an index.html under construction page
Upload this page to your root magento directory
(you have already made that backup, right>?)

Step 2 - Update your .htaccess file

Add the following line to the top of your .htaccess file in the root directory of your magento installation
DirectoryIndex index.html index.php
Also, upload this file to your root magento directory
(rest assured if anything goes wrong, you’ve got that backup!)
This tells the system to use your index.html file before the index.php, this is essential, otherwise your site will show as usual.

Step 3 - Test your front end and continue working

Your frontend should now show the under construction / maintenance page.
To continue working on your site, simply navigate to your frontend and add /index.php
e.g.
www.yourdomainname.com - goes to the under construction HTML page
www.yourdomainname.com/index.php - goes to your website for development purposes
Once everything is backup and running, simply add a hash (#) to the command line in your htaccess file:
#DirectoryIndex index.html index.php

Source : http://www.voodish.co.uk/articles/magento-under-construction-maintenance-page/