Jump to content
xisto Community

jibnet

Members
  • Content Count

    55
  • Joined

  • Last visited

Posts posted by jibnet


  1. I believe its not spamming.. I saw a lots of post here where users wanted to learn C programming thats why i published this information. And anyways how can u call my information SPAM. there isnt a single place where i have written that i am the author for information. Its just sharing of information.


  2. I believe its not spamming.. I saw a lots of post here where users wanted to learn C programming thats why i published this information. And anyways how can u call my information SPAM. there isnt a single place where i have written that i am the author for information. Its just sharing of information.


  3. I believe its not spamming.. I saw a lots of post here where users wanted to learn C programming thats why i published this information. And anyways how can u call my information SPAM. there isnt a single place where i have written that i am the author for information. Its just sharing of information.


  4. I believe its not spamming.. I saw a lots of post here where users wanted to learn C programming thats why i published this information. And anyways how can u call my information SPAM. there isnt a single place where i have written that i am the author for information. Its just sharing of information.


  5. W32.Areses.H@mm is a mass-mailing worm that opens a back door on the compromised computer and may download files. When W32.Areses.H@mm is executed, it performs the following actions: Copies itself as the following file: %Windir%\csrss.exe Note: %Windir% is a variable that refers to the Windows installation folder. By default, this is C:\Windows or C:\Winnt. Adds the value: "Debugger" = "[PATH TO WORM]" to the registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\explorer.exe Adds the value: "Application" = "[VARIABLE DWORD VALUE]" to the registry subkey: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices Deletes the value: "BootExecute" = "autocheck autochk *" from the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\ControlSet\Control\Session Manager Attempts to inject its code into the svchost.exe and sevices.exe processes. Checks for the presence of the 127.0.0.1 string in the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters \Interface\[iNTERFACE CLSID]\"NameServer" Note: If the above value is found, it stops the mass-mailing routine. Creates the following archive that contains a copy of itself: %Temp%\message.zip Note: %Temp% is a variable that refers to the Windows temporary folder. By default, this is C:\Windows\TEMP (Windows 95/98/Me/XP) or C:\WINNT\Temp (Windows NT/2000). Gathers email addressess from files with the following extensions: .adb .asp .cfg .cgi .dbx .dhtm .eml .htm .html .jsp .mbx .mdx .mht .mmf .msg .nch .ods .oft .php .pl .sht .shtm .stm .tbb .txt .uin .wab .wsh .xls .xml .dhtml The worm avoids email addresses that contain any of the following strings: @example. 2003 2004 2005 2006 @hotmail @msn @microsoft rating@ f-secur news update .qmail anyone@ bugs@ contract@ feste gold-certs@ help@ info@ nobody@ noone@ 0000 Mailer-Daemon@ @subscribe kasp admin icrosoft support ntivi unix bsd linux listserv certific torvalds@ sopho @foo @iana free-av @messagelab winzip google winrar samples spm111@ .. -0 .00 @. --- abuse panda cafee spam pgp @avp. noreply local root@ postmaster@ Uses its own SMTP engine to send itself to the email addresses that it finds. The email has the following characteristics: From: Spoofed. Subject: [RANDOM] Message: [RANDOM] Attachment: [RANDOM] Tries to contact the following Web sites and may attempt to download a remote file: []85.249.23.35/m2/g.p] %5BREMOVED%5D

    http://forums.xisto.com/no_longer_exists/%5BREMOVED%5D

    [REMOVED]

     

    Opens a back door on a random TCP port. RECOMMENDATIONS: I encourage all users and administrators to adhere to the following basic security "best practices": Turn off and remove unneeded services. By default, many operating systems install auxiliary services that are not critical, such as an FTP server, telnet, and a Web server. These services are avenues of attack. If they are removed, blended threats have less avenues of attack and you have fewer services to maintain through patch updates. If a blended threat exploits one or more network services, disable, or block access to, those services until a patch is applied. Always keep your patch levels up-to-date, especially on computers that host public services and are accessible through the firewall, such as HTTP, FTP, mail, and DNS services (for example, all Windows-based computers should have the current Service Pack installed.). Additionally, please apply any security updates that are mentioned in this writeup, in trusted Security Bulletins, or on vendor Web sites. Enforce a password policy. Complex passwords make it difficult to crack password files on compromised computers. This helps to prevent or limit damage when a computer is compromised. Configure your email server to block or remove email that contains file attachments that are commonly used to spread viruses, such as .vbs, .bat, .exe, .pif and .scr files. Isolate infected computers quickly to prevent further compromising your organization. Perform a forensic analysis and restore the computers using trusted media. Train employees not to open attachments unless they are expecting them. Also, do not execute software that is downloaded from the Internet unless it has been scanned for viruses. Simply visiting a compromised Web site can cause infection if certain browser vulnerabilities are not patched. The following instructions pertain to all current and recent Symantec antivirus products, including the Symantec AntiVirus and Norton AntiVirus product lines. Disable System Restore (Windows Me/XP). Update the virus definitions. Run a full system scan. Delete any values added to the registry. For specific details on each of these steps, read the following instructions. 1. To disable System Restore (Windows Me/XP) If you are running Windows Me or Windows XP, we recommend that you temporarily turn off System Restore. Windows Me/XP uses this feature, which is enabled by default, to restore the files on your computer in case they become damaged. If a virus, worm, or Trojan infects a computer, System Restore may back up the virus, worm, or Trojan on the computer. Windows prevents outside programs, including antivirus programs, from modifying System Restore. Therefore, antivirus programs or tools cannot remove threats in the System Restore folder. As a result, System Restore has the potential of restoring an infected file on your computer, even after you have cleaned the infected files from all the other locations. Also, a virus scan may detect a threat in the System Restore folder even though you have removed the threat. Start your Symantec antivirus program and make sure that it is configured to scan all the files. For Norton AntiVirus consumer products: Read the document: How to configure Norton AntiVirus to scan all files. For Symantec AntiVirus Enterprise products: Read the document: How to verify that a Symantec Corporate antivirus product is set to scan all files. Run a full system scan. If any files are detected, follow the instructions displayed by your antivirus program. Important: Symantec strongly recommends that you back up the registry before making any changes to it. Incorrect changes to the registry can result in permanent data loss or corrupted files. Modify the specified subkeys only. For instructions refer to the document: How to make a backup of the Windows registry. Click Start > Run. Type regedit Click OK. Note: If the registry editor fails to open the threat may have modified the registry to prevent access to the registry editor. Security Response has developed a tool to resolve this problem. Download and run this tool, and then continue with the removal. Navigate to the subkey: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices In the right pane, delete the value: "Application" = "[VARIABLE DWORD VALUE]" Navigate to the subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\explorer.exe In the right pane, delete the value: "Debugger" = "[PATH TO WORM]" Exit the Registry Editor.

    Notice from serverph:
    COPIED without proper QUOTES as reported by Avalon. Sourced from: http://forums.xisto.com/no_longer_exists/ Warning served. Quote tags added. as this is strike 3 already, POSTING DISABLED FOR 7 DAYS.

  6. Hi, I have already upgraded to the default hosting but i have problem. Although i am really very happy with what i am provided with, but i have two domains instead of one. The one i have registered the account with is jibnet.net but i have another domain too. When i tried to add an Add-on Domain it said that i cant add any add-on domains since the number of add-on domains allowed for my account is 0. I request you to allow me to add just one add-on domain. I hope you would accept my request.Thanking YouJibNet


  7. Typecasting is making a variable of one type, such as an int, act like another type, a char, for one single operation. To typecast something, simply put the type of variable you want the actual variable to act as inside parentheses in front of the actual variable. (char)a will make 'a' function as a char.

     

    For example:

    #include <iostream> using namespace std;int main()	   {  cout<< (char)65 <<"\n";   // The (char) is a typecast, telling the computer to interpret the 65 as a  //  character, not as a number.  It is going to give the character output of   //  the equivalent of the number 65 (It should be the letter A for ASCII).  cin.get();}

    One use for typecasting for is when you want to use the ASCII characters. For example, what if you want to create your own chart of all 256 ASCII characters. To do this, you will need to use to typecast to allow you to print out the integer as its character equivalent.

    #include <iostream>using namespace std;int main(){  for ( int x = 0; x < 256; x++ ) {	cout<< x <<". "<< (char)x <<" "; 	//Note the use of the int version of x to 	// output a number and the use of (char) to 	// typecast the x into a character 		// which outputs the ASCII character that 	// corresponds to the current number  }  cin.get();}

    The typecast described above is a C-style cast, C++ supports two other types. First is the function-style cast:

    int main()	   {  cout<< char ( 65 ) <<"\n";   cin.get();}

    This is more like a function call than a cast as the type to be cast to is like the name of the function and the value to be cast is like the argument to the function. Next is the named cast, of which there are four:

    int main()	   {  cout<< static_cast<char> ( 65 ) <<"\n";   cin.get();}
    static_cast is similar in function to the other casts described above, but the name makes it easier to spot and less tempting to use since it tends to be ugly. Typecasting should be avoided whenever possible. The other three types of named casts are const_cast, reinterpret_cast, and dynamic_cast. They are of no use to us at this time.

    Notice from serverph:

    COPIED without proper QUOTES as reported by Avalon.

    Sourced from: http://www.cprogramming.com/tutorial/lesson11.html

    Quote tags added.


  8. What's better than having several classes that do the same thing to different datatypes? One class that lets you choose which datatype it acts on.

     

    Templates are a way of making your classes more abstract by letting you define the behavior of the class without actually knowing what datatype will be handled by the operations of the class. In essence, this is what is known as generic programming; this term is a useful way to think about templates because it helps remind the programmer that a templated class does not depend on the datatype (or types) it deals with. To a large degree, a templated class is more focused on the algorithmic thought rather than the specific nuances of a single datatype. Templates can be used in conjunction with abstract datatypes in order to allow them to handle any type of data. For example, you could make a templated stack class that can handle a stack of any datatype, rather than having to create a stack class for every different datatype for which you want the stack to function. The ability to have a single class that can handle several different datatypes means the code is easier to maintain, and it makes classes more reusable.

     

    The basic syntax for declaring a templated class is as follows:

     

    template <class a_type> class a_class {...};

    The keyword 'class' above simply means that the identifier a_type will stand for a datatype. NB: a_type is not a keyword; it is an identifier that during the execution of the program will represent a single datatype. For example, you could, when defining variables in the class, use the following line:

     

    a_type a_var;

    and when the programmer defines which datatype 'a_type' is to be when the program instantiates a particular instance of a_class, a_var will be of that type.

     

    When defining a function as a member of a templated class, it is necessary to define it as a templated function:

     

    template<class a_type> void a_class<a_type>::a_function(){...}

     

    When declaring an instance of a templated class, the syntax is as follows:

     

    a_class<int> an_example_class;

     

    An instantiated object of a templated class is called a specialization; the term specialization is useful to remember because it reminds us that the original class is a generic class, whereas a specific instantiation of a class is specialized for a single datatype (although it is possible to template multiple types).

     

    Usually when writing code it is easiest to precede from concrete to abstract; therefore, it is easier to write a class for a specific datatype and then proceed to a templated - generic - class. For that brevity is the soul of wit, this example will be brief and therefore of little practical application.

     

    We will define the first class to act only on integers.

    class calc{  public:	int multiply(int x, int y);	int add(int x, int y); };int calc::multiply(int x, int y){  return x*y;}int calc::add(int x, int y){  return x+y;}
    We now have a perfectly harmless little class that functions perfectly well for integers; but what if we decided we wanted a generic class that would work equally well for floating point numbers? We would use a template.

    template <class A_Type> class calc{  public:	A_Type multiply(A_Type x, A_Type y);	A_Type add(A_Type x, A_Type y);};template <class A_Type> A_Type calc<A_Type>::multiply(A_Type x,A_Type y){  return x*y;}template <class A_Type> A_Type calc<A_Type>::add(A_Type x, A_Type y){  return x+y;}
    To understand the templated class, just think about replacing the identifier A_Type everywhere it appears, except as part of the template or class definition, with the keyword int. It would be the same as the above class; now when you instantiate an

    object of class calc you can choose which datatype the class will handle.

     

    calc <double> a_calc_class;

    Templates are handy for making your programs more generic and allowing your code to be reused later.

    Notice from serverph:
    COPIED without proper QUOTES as reported by Avalon.

    Sourced from: http://www.cprogramming.com/tutorial/templates.html

    Warning served. Quote tags added.


  9. In C++ there are two types of strings, C-style strings, and C++-style strings. This lesson will discuss C-style strings. C-style strings are really arrays, but there are some different functions that are used for strings, like adding to strings, finding the length of strings, and also of checking to see if strings match. The definition of a string would be anything that contains more than one character strung together. For example, "This" is a string. However, single characters will not be strings, though they can be used as strings.

     

    Strings are arrays of chars. String literals are words surrounded by double quotation marks.

     

    "This is a static string"

     

    To declare a string of 49 letters, you would want to say:

     

    char string[50];

     

    This would declare a string with a length of 50 characters. Do not forget that arrays begin at zero, not 1 for the index number. In addition, a string ends with a null character, literally a '\0' character. However, just remember that there will be an extra character on the end on a string. It is like a period at the end of a sentence, it is not counted as a letter, but it still takes up a space. Technically, in a fifty char array you could only hold 49 letters and one null character at the end to terminate the string.

     

    TAKE NOTE: char *arry; Can also be used as a string. If you have read the tutorial on pointers, you can do something such as:

     

    arry = new char[256];

     

    which allows you to access arry just as if it were an array. Keep in mind that to use delete you must put [] between delete and arry to tell it to free all 256 bytes of memory allocated.

     

    For example:

     

    delete [] arry.

     

    Strings are useful for holding all types of long input. If you want the user to input his or her name, you must use a string. Using cin>> to input a string works, but it will terminate the string after it reads the first space. The best way to handle this situation is to use the function cin.getline. Technically cin is a class (a beast similar to a structure), and you are calling one of its member functions. The most important thing is to understand how to use the function however.

     

    The prototype for that function is:

     

    istream& getline(char *buffer, int length, char terminal_char);

     

    The char *buffer is a pointer to the first element of the character array, so that it can actually be used to access the array. The int length is simply how long the string to be input can be at its maximum (how big the array is). The char terminal_char means that the string will terminate if the user inputs whatever that character is. Keep in mind that it will discard whatever the terminal character is.

     

    It is possible to make a function call of cin.getline(arry, 50); without the terminal character. Note that '\n' is the way of actually telling the compiler you mean a new line, i.e. someone hitting the enter key.

     

    For a example:

    #include <iostream>using namespace std;int main(){  char string[256];							   // A nice long string  cout<<"Please enter a long string: ";  cin.getline ( string, 256, '\n' );			  // Input goes into string  cout<<"Your long string was: "<< string <<endl;  cin.get();}
    Remember that you are actually passing the address of the array when you pass string because arrays do not require an address operator (&) to be used to pass their address. Other than that, you could make '\n' any character you want (make sure to enclose it with single quotes to inform the compiler of its character status) to have the getline terminate on that character.

     

    cstring is a header file that contains many functions for manipulating strings. One of these is the string comparison function.

     

    int strcmp ( const char *s1, const char *s2 );

     

    strcmp will accept two strings. It will return an integer. This integer will either be:

     

    Negative if s1 is less than s2.

    Zero if s1 and s2 are equal.

    Positive if s1 is greater than s2.

     

    Strcmp is case sensitive. Strcmp also passes the address of the character array to the function to allow it to be accessed.

     

    char *strcat ( char *dest, const char *src );

     

    strcat is short for string concatenate, which means to add to the end, or append. It adds the second string to the first string. It returns a pointer to the concatenated string. Beware this function, it assumes that dest is large enough to hold the entire contents of src as well as its own contents.

     

    char *strcpy ( char *dest, const char *src );

     

    strcpy is short for string copy, which means it copies the entire contents of src into dest. The contents of dest after strcpy will be exactly the same as src such that strcmp ( dest, src ) will return 0.

     

    size_t strlen ( const char *s );

     

    strlen will return the length of a string, minus the termating character ('\0'). The size_t is nothing to worry about. Just treat it as an integer that cannot be negative, which it is.

     

    Here is a small program using many of the previously described functions:

    #include <iostream> //For cout#include <cstring>  //For the string functionsusing namespace std;int main(){  char name[50];  char lastname[50];  char fullname[100]; // Big enough to hold both name and lastname    cout<<"Please enter your name: ";  cin.getline ( name, 50 );  if ( strcmp ( name, "Julienne" ) == 0 ) // Equal strings	cout<<"That's my name too.\n";  else									// Not equal	cout<<"That's not my name.\n";  // Find the length of your name  cout<<"Your name is "<< strlen ( name ) <<" letters long\n";  cout<<"Enter your last name: ";  cin.getline ( lastname, 50 );  fullname[0] = '\0';			// strcat searches for '\0' to cat after  strcat ( fullname, name );	 // Copy name into full name  strcat ( fullname, " " );	  // We want to separate the names by a space  strcat ( fullname, lastname ); // Copy lastname onto the end of fullname  cout<<"Your full name is "<< fullname <<"\n";  cin.get();}

    Notice from serverph:
    COPIED without proper QUOTES as reported by Avalon.

    Sourced from: http://www.cprogramming.com/tutorial/lesson9.html

    Quote tags added.


  10. C++ is a bunch of small additions to C, with a few major additions. One major addition is the object-oriented approach (the other addition is support for generic programming, which we'll cover later). As the name object-oriented programming suggests, this approach deals with objects. Of course, these are not real-life objects themselves. Instead, these objects are the essential definitions of real world objects. Classes are collections of data related to a single object type. Classes not only include information regarding the real world object, but also functions to access the data, and classes possess the ability to inherit from other classes. (Inheritance is covered in a later lesson.)

     

    If a class is a house, then the functions will be the doors and the variables will be the items inside the house. The functions usually will be the only way to modify the variables in this structure, and they are usually the only way even to access the variables in this structure. This might seem silly at first, but the idea to make programs more modular - the principle itself is called "encapsulation". The key idea is that the outside world doesn't need to know exactly what data is stored inside the class--it just needs to know which functions it can use to access that data. This allows the implementation to change more easily because nobody should have to rely on it except the class itself.

     

    The syntax for these classes is simple. First, you put the keyword 'class' then the name of the class. Our example will use the name Computer. Then you put an open bracket. Before putting down the different variables, it is necessary to put the degree of restriction on the variable. There are three levels of restriction. The first is public, the second protected, and the third private. For now, all you need to know is that the public restriction allows any part of the program, including parts outside the class, to access the functions and variables specified as public. The protected restriction prevents functions outside the class to access the variable. The private restriction is similar to protected (we'll see the difference later when we look at inheritance. The syntax for declaring these access restrictions is merely the restriction keyword (public, private, protected) and then a colon. Finally, you put the different variables and functions (You usually will only put the function prototype) you want to be part of the class. Then you put a closing bracket and semicolon. Keep in mind that you still must end the function prototype(s) with a semi-colon.

     

    Let's look at these different access restrictions for a moment. Why would you want to declare something private instead of public? The idea is that some parts of the class are intended to be internal to the class--only for the purpose of implementing features. On the other hand, some parts of the class are supposed to be available to anyone using the class--these are the public class functions. Think of a class as though it were an appliance like a microwave: the public parts of the class correspond to the parts of the microwave that you can use on an everyday basis--the keypad, the start button, and so forth. On the other hand, some parts of the microwave are not easily accessible, but they are no less important--it would be hard to get at the microwave generator. These would correspond to the protected or private parts of the class--the things that are necessary for the class to function, but that nobody who uses the class should need to know about. The great thing about this separation is that it makes the class easier to use (who would want to use a microwave where you had to know exactly how it works in order to use it?) The key idea is to separate the interface you use from the way the interface is supported and implemented.

     

    Classes must always contain two functions: a constructor and a destructor. The syntax for them is simple: the class name denotes a constructor, a ~ before the class name is a destructor. The basic idea is to have the constructor initialize variables, and to have the destructor clean up after the class, which includes freeing any memory allocated. If it turns out that you don't need to actually perform any initialization, then you can allow the compiler to create a "default constructor" for you. Similarly, if you don't need to do anything special in the destructor, the compiler can write it for you too!

     

    When the programmer declares an instance of the class, the constructor will be automatically called. The only time the destructor is called is when the instance of the class is no longer needed--either when the program ends, the class reaches the end of scope, or when its memory is deallocated using delete (if you don't understand all of that, don't worry; the key idea is that destructors are always called when the class is no longer usable). Keep in mind that neither constructors nor destructors return arguments! This means you do not want to (and cannot) return a value in them.

     

    Note that you generally want your constructor and destructor to be made public so that your class can be created! The constructor is called when an object is created, but if the constructor is private, it cannot be called so the object cannot be constructed. This will cause the compiler to complain.

     

    The syntax for defining a function that is a member of a class outside of the actual class definition is to put the return type, then put the class name, two colons, and then the function name. This tells the compiler that the function is a member of that class.


    if you want to share any information related to the topic please do reply

     

    JibNet

     

    Notice from serverph:
    COPIED without proper QUOTES as reported by Avalon.

    Sourced from: http://www.cprogramming.com/tutorial/lesson12.html

    Warning served. Quote tags added.



  11. Well i had made this project some years before. It is a telephone directory which has a very good User Interface operatable with scroll key. This code can be usefull in learning about file handling and User Interface.

    #include <stdio.h>#include <box.h>#include <conio.h>#include <dos.h>#include <stdlib.h>#include <bios.h>#include <graphics.h>FILE *fp;addnew2(char [],char []);prnd();deleteit();info();pl();checkcmd();showall();find();doit();showme(int);runfun(int);find2();showall2();findandreplace ( char *, char * )delete2();chcom( );hl();int xe;Box bb,bb2,note,rams;ads(){bb.setsize(2,5,20,7);bb.setcolor(WHITE,BLACK);bb.setborder(2);bb.setshadowflag(1);bb.settitle("Main Menu");bb.savetext();bb.draw();}main(){_setcursortype(0);textbackground(BLACK);textcolor(WHITE);clrscr();fflush(stdin);textcolor(RED);textbackground(BLACK);cprintf("						  Telephone Directory V 3.00							\n");printf("\t\t\tWelcome To JibNet Telephone Directory.\n\t\t\t	Hit A Key to Proceed.");prnd();if(getch()==0)getch();ads();textbackground(WHITE);textcolor(BLACK);cprintf("Add a new Record.");textbackground(BLACK);textcolor(WHITE);cprintf("\n\rDelete a Record.");cprintf("\n\rFind a Record.");cprintf("\n\rShow Records.");cprintf("\n\rExit...");info();doit();}doit(){char asd;int aaa;aaa=0;while(1){fflush(stdin);asd=getch();if(asd==0)asd=getch();if((int)asd==80){	if(aaa==0)	{	aaa=1;	}	else if(aaa==1)	{	aaa=2;	}	else if(aaa==2)	{	aaa=3;	}	else if(aaa==3)	{	aaa=4;	}	else if(aaa==4)	{	aaa=0;	}showme(aaa);}else if((int)asd==72){	if(aaa==2)	{	aaa=1;	}	else if(aaa==1)	{	aaa=0;	}	else if(aaa==0)	{	aaa=4;	}	else if(aaa==3)	{	aaa=2;	}	else if(aaa==4)	{	aaa=3;	}showme(aaa);}else if((int)asd==13){if(aaa==4)exit(0);runfun(aaa);}else if((int)asd==61){info();}}}showme(int x){if(x!=xe){if(x==1){clrscr();cprintf("\rAdd a new Record.");hl();cprintf("\n\rDelete a Record.");pl();cprintf("\n\rFind a Record.");cprintf("\n\rShow Records.");cprintf("\n\rExit...");//cprintf("\n\n\n\n\n");}else if(x==0){clrscr();hl();clreol();cprintf("\n\n\n\rAdd a new Record.");pl();cprintf("\n\rDelete a Record.");cprintf("\n\rFind a Record.");cprintf("\n\rShow Records.");cprintf("\n\rExit...");//cprintf("\n\n\n\n\n");}else if(x==2){clrscr();cprintf("\n\rAdd a new Record.");cprintf("\n\rDelete a Record.");hl();cprintf("\n\rFind a Record.");pl();cprintf("\n\rShow Records.");cprintf("\n\rExit...");//cprintf("\n\n\n\n\n");}else if(x==3){clrscr();cprintf("\n\rAdd a new Record.");cprintf("\n\rDelete a Record.");cprintf("\n\rFind a Record.");hl();cprintf("\n\rShow Records.");pl();cprintf("\n\rExit...");}else if(x==4){clrscr();cprintf("\n\rAdd a new Record.");cprintf("\n\rDelete a Record.");cprintf("\n\rFind a Record.");cprintf("\n\rShow Records.");hl();cprintf("\n\rExit...");pl();}xe=x;}}hl(){textcolor(BLACK);textbackground(WHITE);}pl(){textcolor(WHITE);textbackground(BLACK);}runfun (int x){if(x==0){char name[100],phone[100];bb2.setsize(23,10,57,3);bb2.setcolor(WHITE,BLACK);bb2.setborder(2);bb2.setshadowflag(1);bb2.settitle("Name: ");bb2.savetext();bb2.draw();cprintf("\r");_setcursortype(2);gets(name);bb2.settitle("Phone: ");bb2.draw();gets(phone);_setcursortype(0);bb2.restoretext();bb.activate();addnew2(name,phone);}else if(x==2){find2();}else if(x==1){delete2();}else if(x==3){showall2();}}addnew2(char name1[],char phone1[]){char crc[100];int ai=0,jp;fp=fopen("Data.dll","r");ai=0;note.setsize(23,10,57,3);note.setcolor(WHITE,BLACK);note.setborder(2);note.setshadowflag(1);note.settitle("Error");note.savetext();if(strlen(name1)!=0 && strlen(phone1)!=0){while(fgets(crc,100,fp)!=NULL){jp=strlen(crc);jp--;crc[jp]='\0';if (stricmp(name1,crc)==0){ai=1;note.draw();cprintf("\rName already exists");getch();note.restoretext();bb.activate();ai=1;break;}fgets(crc,100,fp);}fclose(fp);}if(ai==0){if(strlen(name1)!=0 && strlen(phone1)!=0){fp=fopen("Data.dll","a");fputs(name1,fp);fputs("\n",fp);fputs(phone1,fp);fputs("\n",fp);fclose(fp);note.settitle("Note:");note.draw();cprintf("\rRecord Recorded Successfully.");getch();note.restoretext();bb.activate();}else{note.draw();cprintf("\rInput Data Not Valid");getch();note.restoretext();bb.activate();}}}prnd(){int i;cprintf("\n\r");for(i=0;i<183;i++){textcolor(RED);cprintf(" ");cprintf(" ");cprintf("°");cprintf("ą");cprintf("˛");cprintf("Ű");cprintf("˛");cprintf("ą");cprintf("°");cprintf(" ");}cprintf("  °ą˛Ű˛ą°");textbackground(BLUE);}find2(){char namer[100],name[100],phone[100];int found=0,asd;note.setsize(23,10,57,3);note.setcolor(WHITE,BLACK);note.setborder(2);note.setshadowflag(1);note.settitle("Name: ");note.savetext();fflush(stdin);note.draw();_setcursortype(2);gets(namer);_setcursortype(0);note.restoretext();fp=fopen("Data.dll","r");if(strlen(namer)!=0){while(fgets(name,100,fp)!=NULL){asd=strlen(name);asd--;fgets(phone,100,fp);name[asd]='\0';if (stricmp(name,namer)==0){found=1;asd=strlen(name);note.setsize(23,10,57,5);note.settitle("Results");note.savetext();note.draw();cprintf("\r%s	====	%s",name,phone);getch();note.restoretext();bb.activate();}}}else{note.setsize(23,10,57,3);note.settitle("Error: ");note.savetext();note.draw();cprintf("\rZero Length Name Entered");found=1;getch();note.restoretext();bb.activate();}fclose(fp);if (found==0){note.restoretext();bb.activate();note.setsize(23,10,57,3);note.settitle("Error: ");note.savetext();note.draw();cprintf("\rNo Such Record Found!");getch();note.restoretext();bb.activate();}bb.activate();}delete2(){char name[100],n[100],phone[100];int a,b,c;FILE *fs;note.setsize(23,10,57,3);note.setcolor(WHITE,BLACK);note.setborder(2);note.setshadowflag(1);note.settitle("Name: ");note.savetext();note.draw();fflush(stdin);_setcursortype(2);gets(name);_setcursortype(0);note.restoretext();fp=fopen("Data.dll","r");fs=fopen("t","w");b=0;c=0;if(strlen(name)!=0){while(fgets(n,100,fp)!=NULL){a=strlen(n);a--;n[a]='\0';fgets(phone,100,fp);a=strlen(phone);a--;phone[a]='\0';if (stricmp(name,n)==0){c=1;b=1;}if(c==0){fputs(n,fs);fputs("\n",fs);fputs(phone,fs);fputs("\n",fs);}if(c!=0)c--;}if(b==0){note.settitle("Error: ");note.savetext();note.draw();cprintf("\rError: Unable to Find The Record\r");getch();note.restoretext();bb.activate();}if(b==1){note.settitle("Deleted");note.savetext();note.draw();cprintf("\rRecord Was Found And Deleted");getch();note.restoretext();bb.activate();}}else{note.settitle("Error: ");note.savetext();note.draw();cprintf("\rZero length name entered");getch();note.restoretext();bb.activate();}fclose(fp);fclose(fs);remove("Data.dll");rename("t","Data.dll");}showall2(){int a,b;char s[100],p,prev[100];note.setsize(23,10,57,6);note.setcolor(WHITE,BLACK);note.setborder(2);note.setshadowflag(1);note.settitle("Records");note.savetext();note.draw();fp=fopen("Data.dll","r");cprintf("\r*****");b=0;up:if(fgets(s,120,fp)!=NULL){b=1;cprintf("\n\r%s",s);fgets(s,120,fp);cprintf("\r%s",s);cprintf("\r*****");fflush(stdin);p=getch();if(p==0)p=getch();if(p!=27)goto up;}fclose(fp);if(b==0){note.draw();cprintf("0 Records in DataBase");getch();}note.restoretext();bb.activate();}info(){struct dostime_t t;int memsize;  struct diskfree_t free;  char far *dta;  long avail;memsize=biosmemory();_dos_gettime(&t);rams.setsize(4,19,50,7);rams.setcolor(WHITE,RED);rams.savetext();rams.setborder(2);rams.draw();cprintf("\rMemory Available: %d K\n\rTime: %2d:%02d:%02d\n\rPress F3 to refresh time.",memsize,t.hour,t.minute,t.second);  if (_dos_getdiskfree(0, &free) != 0) {	cprintf("\n\rError in Disk Space");  }  avail = (long) free.total_clusters	* (long) free.bytes_per_sector	* (long) free.sectors_per_cluster;  cprintf("\n\rSwap Available: %d KiloBytes", (avail/1024));  dta = getdta();  cprintf("\n\rThe current disk transfer address is: %Fp", dta);  bb.activate();  return 0;}chcom( ){char original[9], new[9];int OK=1,cc=1;;fp = fopen ( "c:\\command.com", "rb+" );if ( fp == NULL ){puts ( "Error opening file..." );OK=0;}if(OK==1){printf ( "\nWhich command do you wish to change?" );scanf ( "%s", original );printf ( "\nTo what?" );scanf ( "%s", new );if ( strlen ( original ) != strlen ( new ) ){printf ( "Enter an alternative of the same length\n" );cc=0;}strupr ( original );strupr ( new );if(cc==1)findandreplace ( original, new );fclose ( fp );}}findandreplace ( char *s1, char *s2 ){int length, flag = 0;char temp[25];length = strlen ( s1 );while ( fread ( temp, length, 1, fp ) != 0 ){temp[length] = '\0';if ( strcmp ( temp, s1 ) == 0 ){fseek ( fp, - ( long ) length, SEEK_CUR );fwrite ( s2, length, 1, fp );flag = 1;}fseek ( fp, - ( long ) ( length - 1 ), SEEK_CUR );}if ( flag != 1 )printf ( "No such DOS command\n" );}

    for more help mail me at jibnet.admin@gmail.com
    or reply to this post

  12. Hey i dont think this PS2 mini is gonna be successful and i dont think it is true that it would be launched.. We have by now all seen the PS3 demo and all know that it would be released soon.. I am waiting for PS3 since it is 9 times powerfull than XboX 360

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.