Monday, June 26, 2017

Setting and Retrieving Cookies in ASP .net

A simple yet good example for explaining how we can set and retrieve cookies through an ASP .net web page. Cookies are small bit of text, which can be stored either in client (Web Browser) or on Server.
Partial Class Cookies
Inherits System.Web.UI.Page

Protected Sub btnSet_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSet.Click
 Dim cookieExample As New HttpCookie(CookieExample.txt”)
 cookieExample.Item(“name”) = txtName.Text
 cookieExample.Item(“class”) = txtClass.Text
 cookieExample.Expires = Date.Now.AddSeconds(30)
 Response.Cookies.Add(cookieExample) ‘Adding cookie to local machine
End Sub

Protected Sub btnRetrieve_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRetrieve.Click
 Try
  txtName2.Text = Request.Cookies(CookieExample.txt”).Item(“name”)
  txtClass2.Text = Request.Cookies(CookieExample.txt”).Item(“class”)
  Catch ex As Exception
  MsgBox(“Sorry, session expired..!!”)
 End Try
End Sub

End Class

Sunday, June 25, 2017

Change windows 7 Log on Screen without any software


Here is a simple and easy trick to change the logon screen of  windows 7
  • Download the registry file from hereExtract the file and double-click the registry entry to add into system.
  • Now go to the following folder C:\Windows\System32\oobe.
  • Here create a new folder Info in the oobe folder.
  • Again create a new folder named backgrounds inside the Info folder.
  • Copy your favorite image file into this folder (backgrounds) and rename this as backgroundDefault.
  • The image must be JPG format and size must be less than 256 KB.
  • Now Reboot your PC and see the change.
Like and Share if you like this post.

Monday, January 2, 2017

Prime no program in JAVA using recursive function

Simple and Easy program to find check for a number to be prime number in Java, using recursive function.

public class Prime
{
 public static void main(String[] args)
 {
  if(args.length<1 -1="" 0="" 1="" argument..="" boolean="" div-1="" div="=" else="" false="" if="" int="" is="" isprime="" no="" not="" nsufficient="" num="" pre="" prime..="" return="" static="" system.out.println="" true="">

Sunday, September 2, 2012

Finding Factorial Using Recursive function in JAVA

Simple and Easy Java program to find factorial of a number in Java, using recursive function.


public class Factorial
{
 public static int factorial(int no)
 {
  int fact;
  if(no==1)
   return 1;
  else
   fact=no*factorial(no-1);
  return fact;
 }

 public static void main(String args[])
 {
  if(args.length!=1)
  {
   System.out.println("1 argument required..");
   return;
  }
  int no=Integer.parseInt(args[0]);
  int fact;
  fact=factorial(no);
  System.out.println("Factorial is : "+fact);
 }
}

JAVA Program to count digits in a number

Finding the number of digits in a number using a Java program was never been that easy. Here is how you can finding the number of digits in a number using a simple Java program.

public class CountDigit
{
 public static void main(String args[])
 {
                if(args.length!=1)
  {
   System.out.println("1 Argument Required..");
   return;
  }
               
  int no=Integer.parseInt(args[0]);
                int cnt=0;
                while(no>0)
                {
   cnt++;
   no=no/10;
                }
                System.out.println("\n Total Digits are : " + cnt);
 }
}

Palindrome Number program in JAVA

Easy and Simple program to check for a number to be a palindrome number, in Java.

public class Palindrome
{
 public static void main(String arg[])
 {
  if (arg.length!=1)
  {
   System.out.println("1 Argument Required..");
   return;
  }
               
                int no=Integer.parseInt(arg[0]);
                int no2=0,x=no;
                while(no>0)
                {
   no2=(no2*10)+(no%10);
   no=no/10;
                }
                System.out.println("\nOriginal No. : " + x);
                System.out.println("Reversed No. : " + no2 + "\n");
                if(x==no2)
   System.out.println(x + " is Palindrome..");
                else
   System.out.println(x + "is not Palindrome..");
 }
}

Saturday, September 1, 2012

Top Pages are not Showing in Blogger

Sometime we face some problems in Blogger like the Top pages are showing up. When you try to add the Page Gadget from the Gadgets option, it show "Already added". But we don't see any page gadget on the template layout. It happen many times when we use templates from some other sources. To solve this problem, follow the below steps.


  1. Go to Blogger Dashboard.
  2. Now click on Pages. You will see the list of all your pages.
  3. There is an option Show pages as. There will be Don't show selected. Click on this.

 4. Change it to Top tabs.

5. Now click on the Save arrangement button and you are done.











Now you will see all your pages appearing there. You can change the order and so in the Page Gadgets.
Enjoy..!!
Happy Blogging...