Sunday, 25 November 2012

How to change the port number in wamp server in windows

  Hello Mates...
                       Do you guys know how to change the port no of Wamp Server..



  • First STOP all the services of wamp and exit from wamp if you are already using it..
  • Follow the path

          +Wamp Root Folder
                 +bin
                     +apache
                            +apache2.2.22(changes based on version of apache using)
                                 +conf
Ex:  C:\wamp\bin\apache\apache2.2.22\conf 

  • In the conf folder select and open with notepad "httpd.conf" file
  • After Entering in the notepad use ctrl+F and search the file for 80 or word "Listen".














Change Listen value as shown












  • Do not use the port no that belongs to os or some other software..
  • Save the file and exit 
  • Start the "wamp server" and start the services
  • You can see  your "wamp" running in your assigned port no..



















Wednesday, 27 June 2012

problem: All my exe files are opening in notepad or vlc player etc..

All my .exe files are opening in notepad or firefox or vlc etc..

step1:- Create a new text document
step2:- Copy the code  given below to that document



Windows Registry Editor Version 5.00

;this code is for fixing the exe files in vista and windows 7
[-HKEY_CLASSES_ROOT\.exe]

[HKEY_CLASSES_ROOT\.exe]
@="exefile"
"Content Type"="application/x-msdownload"

[HKEY_CLASSES_ROOT\.exe\PersistentHandler]
@="{098f2470-bae0-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\exefile]
@="Application"
"EditFlags"=hex:38,07,00,00
"FriendlyTypeName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\
  00,6f,00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,\
  32,00,5c,00,73,00,68,00,65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,\
  00,2c,00,2d,00,31,00,30,00,31,00,35,00,36,00,00,00

[HKEY_CLASSES_ROOT\exefile\DefaultIcon]
@="%1"

[HKEY_CLASSES_ROOT\exefile\shell]

[HKEY_CLASSES_ROOT\exefile\shell\open]
"EditFlags"=hex:00,00,00,00

[HKEY_CLASSES_ROOT\exefile\shell\open\command]
@="\"%1\" %*"
"IsolatedCommand"="\"%1\" %*"

[HKEY_CLASSES_ROOT\exefile\shell\runas]
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\exefile\shell\runas\command]
@="\"%1\" %*"
"IsolatedCommand"="\"%1\" %*"

[HKEY_CLASSES_ROOT\exefile\shell\runasuser]
@="@shell32.dll,-50944"
"Extended"=""
"SuppressionPolicyEx"="{F211AA05-D4DF-4370-A2A0-9F19C09756A7}"

[HKEY_CLASSES_ROOT\exefile\shell\runasuser\command]
"DelegateExecute"="{ea72d00e-4960-42fa-ba92-7792a7944c1d}"

[HKEY_CLASSES_ROOT\exefile\shellex]

[HKEY_CLASSES_ROOT\exefile\shellex\ContextMenuHandlers]
@="Compatibility"

[HKEY_CLASSES_ROOT\exefile\shellex\ContextMenuHandlers\Compatibility]
@="{1d27f844-3a1f-4410-85ac-14651078412d}"

[HKEY_CLASSES_ROOT\exefile\shellex\DropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"

[-HKEY_CLASSES_ROOT\SystemFileAssociations\.exe]

[HKEY_CLASSES_ROOT\SystemFileAssociations\.exe]
"FullDetails"="prop:System.PropGroup.Description;System.FileDescription;System.ItemTypeText;System.FileVersion;System.Software.ProductName;System.Software.ProductVersion;System.Copyright;*System.Category;*System.Comment;System.Size;System.DateModified;System.Language;*System.Trademarks;*System.OriginalFileName"
"InfoTip"="prop:System.FileDescription;System.Company;System.FileVersion;System.DateCreated;System.Size"
"TileInfo"="prop:System.FileDescription;System.Company;System.FileVersion;System.DateCreated;System.Size"

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.exe]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.exe]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.exe\OpenWithList]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.exe\OpenWithProgids]
"exefile"=hex(0):



step4:-click on file option and click on save as
step5:-
          ->Save the file extension as ".reg"
          ->type="All Files"
          ->encoding="Unicode"
        and Then Save


Don't have enough patience to do all this..?
Not at all a problem

Just download the register file from below link
http://www.mediafire.com/download.php?b6epk9uo2xk42bd


step 6:-
        Now right click on the file and select "merge".
           then press "ok"


step 7: reboot the system..

                 

All my .lnk files are opening in notepad or firefox and bla bla bla..

All my .lnk files are opening in notepad or firefox etc..

step1:- Create a new text document
step2:- Copy the code  given below to that document



Windows Registry Editor Version 5.00

;LNK file association fix for Windows Vista.
;Updated on April 24, 2007

[HKEY_CLASSES_ROOT\.lnk]
@="lnkfile"

[HKEY_CLASSES_ROOT\.lnk\ShellEx]

[HKEY_CLASSES_ROOT\.lnk\ShellEx\{000214EE-0000-0000-C000-000000000046}]
@="{00021401-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT\.lnk\ShellEx\{000214F9-0000-0000-C000-000000000046}]
@="{00021401-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT\.lnk\ShellEx\{00021500-0000-0000-C000-000000000046}]
@="{00021401-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT\.lnk\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{00021401-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT\.lnk\ShellNew]
"Handler"="{ceefea1b-3e29-4ef1-b34c-fec79c4f70af}"
"IconPath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\
  74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
  00,68,00,65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,\
  31,00,36,00,37,00,36,00,39,00,00,00
"ItemName"="@shell32.dll,-30397"
"MenuText"="@shell32.dll,-30318"
"NullFile"=""
"Command"=-

[HKEY_CLASSES_ROOT\.lnk\ShellNew\Config]
"DontRename"=""

[HKEY_CLASSES_ROOT\lnkfile]
@="Shortcut"
"EditFlags"=dword:00000001
"FriendlyTypeName"="@shell32.dll,-4153"
"NeverShowExt"=""
"IsShortcut"=""

[HKEY_CLASSES_ROOT\lnkfile\CLSID]
@="{00021401-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT\lnkfile\shellex]

[HKEY_CLASSES_ROOT\lnkfile\shellex\ContextMenuHandlers]

[HKEY_CLASSES_ROOT\lnkfile\shellex\ContextMenuHandlers\OpenContainingFolderMenu]
@="{37ea3a21-7493-4208-a011-7f9ea79ce9f5}"

[HKEY_CLASSES_ROOT\lnkfile\shellex\ContextMenuHandlers\{00021401-0000-0000-C000-000000000046}]
@=""

[HKEY_CLASSES_ROOT\lnkfile\shellex\DropHandler]
@="{00021401-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT\lnkfile\shellex\IconHandler]
@="{00021401-0000-0000-C000-000000000046}"

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.lnk\UserChoice]

step4:-click on file option and click on save as
step5:-
          ->Save the file extension as ".reg"
          ->type="All Files"
          ->encoding="Unicode"
        and Then Save


If you don't have enough patience to do all this 
You can download the register file from below link

http://www.mediafire.com/download.php?0k5iafvlp930j0f



step 6:-
            Now,Right click on the register file and select merge.
           then press ok
step 7: reboot the system..
                 

Thursday, 14 June 2012

/*
Write a C program to display the contents of a file. 
*/
# include<stdio.h>
main( )
{
FILE *fp ;
char ch ;

fp = fopen ( "PR1.C", "r" ) ;

while ( 1 )
{
ch = fgetc ( fp ) ;

if ( ch == EOF )
break ;

printf ( "%c", ch ) ;
}

fclose ( fp ) ;
}

C program which reverses the first n charecters in a file

/* 

Write a C program to reverse the first n characters in a file.
(Note: The file name and n are specified on the command line.)

*/

#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <process.h>
void main(int argc, char *argv[])
{
  char a[15];
  char s[20];
  char n;
  int k;
  int j=0;
  int i;
  int len;
  FILE *fp;
  if(argc!=3)
  {
  puts("Improper number of arguments.");
  exit(0);
  }
  fp = fopen(argv[1],"r");
  if(fp == NULL)
  {
  puts("File cannot be opened.");
  exit(0);
  }
  k=*argv[2]-48;
  n = fread(a,1,k,fp);
  a[n]='\0';
  len=strlen(a);
  for(i=len-1;i>=0;i--)
  {
s[j]=a[i];
printf("%c",s[j]);
j=j+1;
}
s[j+1]='\0';
getch();
}

12a C program which copies one file to another

 /* Write a C program which copies one file to another.*/
#include <stdio.h>
#include <conio.h>
#include <process.h>
void main(int argc, char *argv[])
{
FILE *fs,*ft;
char ch;
clrscr();
if(argc!=3)
{
puts(“Invalid number of arguments.”);
exit(0);
}
fs = fopen(argv[1],”r”);
if(fs==NULL)
{
puts(“Source file cannot be opened.”);
exit(0);
}
ft = fopen(argv[2],”w”);
if (ft==NULL)
{
puts(“Target file cannot be opened.”);
fclose(fs);
exit(0);
}
while(1)
{
ch=fgetc(fs);
if (ch==EOF)
break;
else
fputc(ch,ft);
}
fclose(fs);
fclose(ft);
getch();
}

10b C program for Roman Numeral conversion

/*  Write a C program to convert a Roman numeral to its decimal equivalent.*/

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
void main()
{
int *a,len,i,j,k;
char *rom;
clrscr();
printf(“Enter the Roman Numeral:”);
scanf(“%s”,rom);
len=strlen(rom);
for(i=0;i<len;i++)
{
if(rom[i]==’I')
a[i]=1;
else if(rom[i]==’V')
a[i]=5;
else if(rom[i]==’X')
a[i]=10;
else if(rom[i]==’L')
a[i]=50;
else if(rom[i]==’C')
a[i]=100;
else if(rom[i]==’D')
a[i]=500;
else if(rom[i]==’M')
a[i]=1000;
else
{
printf(“\nInvalid Value”);
getch();
exit(0);
}
}
k=a[len-1];
for(i=len-1;i>0;i–)
{
if(a[i]>a[i-1])
k=k-a[i-1];
else if(a[i]==a[i-1] || a[i]<a[i-1])
k=k+a[i-1];
}
printf(“\nIts Decimal Equivalent is:”);
printf(“%d”,k);
getch();
}