C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 15th, 2007, 01:49 AM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
Exclamation General - C++ login thing HELP

#include <iostream>
#include <string>

using namespace srd;

int main()
{

string pass1 = "justin";
string users1 = "justin";
string password;
string users;
int z;
cout<<""<<endl;
system("title E-SHELL");
cout<<""<<endl;
cout<<"Username: ";
cin>>users;
cout<<"Password: ";
cin>>password;
if(users = users1)
{
z=z+1;
}
if(password = pass1)
{
z=z+1;
}

while(z=2)
{
cout<<"hello"<<endl;
cout<<"test"<<endl;
}
}









okay wats the hell is wrong w/this ??? anyone help?

Reply With Quote
  #2  
Old August 15th, 2007, 04:15 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
I'm not sure what you are trying to do, so I can only guess what's wrong. Programs always work perfectly, they just do not always do what you wanted them to do

I guess you do not want to use a while loop, but if you do than the comparison should probably use a double =

Code:
while(z==2)
{
cout<<"hello"<<endl;
cout<<"test"<<endl;
}
__________________
There is no such thing as C/C++, you either program C or C++

Reply With Quote
  #3  
Old August 15th, 2007, 02:56 PM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
------ Build started: Project: login_e-shell, Configuration: Debug Win32 ------
Compiling...
login.cpp
.\login.cpp(41) : error C2451: conditional expression of type 'std::basic_string<_Elem,_Traits,_Ax>' is illegal
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
.\login.cpp(45) : error C2451: conditional expression of type 'std::basic_string<_Elem,_Traits,_Ax>' is illegal
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Build log was saved at "file://c:\Documents and Settings\Justin Edelson\My Documents\Visual Studio 2005\Projects\login_e-shell\login_e-shell\Debug\BuildLog.htm"
login_e-shell - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========




thats my vc++ error...im using professional edish

Reply With Quote
  #4  
Old August 15th, 2007, 05:00 PM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
Use == instead of =
in the following lines:

Code:
if(users = users1)
if(password = pass1)

Also you want to use: using namespace std;

Reply With Quote
  #5  
Old August 16th, 2007, 12:39 AM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
Quote:
Originally Posted by Icon
Use == instead of =
in the following lines:

Code:
if(users = users1)
if(password = pass1)

Also you want to use: using namespace std;

i did that and no errors but when i compile and run it.. and type in the user and password when it asks... it just says "press any key to continue".. and closes

Reply With Quote
  #6  
Old August 16th, 2007, 02:46 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
Hmm.. I changed the line int z; to int z = 0; and now when I type justin / justin I get 'hello' and 'test' repeatedly on the screen. If I type any other thing I get the 'Press a key to continue'. Hope that helps

Reply With Quote
  #7  
Old August 16th, 2007, 03:23 AM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
Quote:
Originally Posted by Icon
Hmm.. I changed the line int z; to int z = 0; and now when I type justin / justin I get 'hello' and 'test' repeatedly on the screen. If I type any other thing I get the 'Press a key to continue'. Hope that helps
i did that but still same

Reply With Quote
  #8  
Old August 18th, 2007, 01:20 AM
Lobo426 Lobo426 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Posts: 6 Lobo426 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 25 m 35 sec
Reputation Power: 0
Quote:
Originally Posted by justinede
i did that but still same

you are in an infinite loop, that is why it keeps repeating.

anyway try this simple version, you can get fancier as you learn:
Code:
#include<iostream>
#include<string>
using namespace std;

int main(){
string pass1="justin", user1="justin";
string pass, user;

cout<<"Username: "; cin>>user;
cout<<"Password: "; cin>>pass;
if(user1==user && pass1=pass) cout<<"hello\ntest";

return 0;
}

Reply With Quote
  #9  
Old August 18th, 2007, 05:56 PM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
Quote:
Originally Posted by Lobo426
you are in an infinite loop, that is why it keeps repeating.

anyway try this simple version, you can get fancier as you learn:
Code:
#include<iostream>
#include<string>
using namespace std;

int main(){
string pass1="justin", user1="justin";
string pass, user;

cout<<"Username: "; cin>>user;
cout<<"Password: "; cin>>pass;
if(user1==user && pass1=pass) cout<<"hello\ntest";

return 0;
}


ok that works great and i intergrated it into my project... but i forgot how do make a does not.. so if user1 (does not =) user than an error messge.. but i forgot how to do that..

Reply With Quote
  #10  
Old August 19th, 2007, 04:20 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
!=

I'd also change the line:
if(user1==user && pass1=pass) cout<<"hello\ntest";
into
if(user1==user && pass1==pass) cout<<"hello\ntest";

Otherwise it will return true for all passwords of user1. Im still wondering why your first version did not work if you corrected it properly.. But well..

Reply With Quote
  #11  
Old August 20th, 2007, 02:09 AM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
//JUSTIN'S E-SHELL CODE
#include <iostream>
#include <fstream>
#include <string>
#include <cstdio>
#include <ctime>
using namespace std;

int main()
{
char dateStr[9];
_strdate_s(dateStr, 9);
string date = dateStr;
char timeStr[9];
_strtime_s(timeStr, 9);
string time = timeStr;
string command ;
string argument;
string input;
ifstream infile;
string cat;
cout << "Justin Edelson Corporation E-SHELL [v.2.0]"<<endl;
cout << "<C> Copy Right 2007 All Rights Reserved"<<endl;
cout<<""<<endl;
string user = "Guest";
//cout<<"Logged in as: "<<user<<endl;
// cout <<"DATE: " << date << endl;
// cout <<"TIME: " << time << endl;
string pass1 = "admin";
string users1 = "justin";
string users2 = "admin";
string pass2 = "admin";
string password;
string users;
int z = 0;
cout<<""<<endl;
system("title E-SHELL");
cout<<""<<endl;
cout<<"Username: ";
cin>>users;
cout<<"Password: ";
cin>>password;
if(users == users1 | users == users2)
{
z=z+1;
}
if(password == pass1 | password == pass2)
{
z=z+1;
}
if(z==2)
{
cout<<""<<endl;
string user = users;
system("color 07");
cout<<"Logged in as: "<<user<<endl;
}

while(z==2)
{
cout<<""<<endl;
cout << "E-SHELL v.2.0> ";
getline(cin, input);
int pos = input.find(" ");
command = input.substr(0, pos);
if(command == "cat")
{
argument = input.substr(pos+1);
infile.open(argument.c_str());

if (!infile.is_open())
{
cerr <<"Could not open file.\n";
exit(-1);
}
//do cat code heren (just a while loop with getline)
while(getline(infile, cat))
{
cout<<""<<endl;
cout << cat << endl;
}
}
else if(command == "exit")
{
exit(0);
}
else if(command == "ls")
{
cout<<""<<endl;
cout<<"Add all to see hidden files"<<endl;
cout<<""<<endl;
system("dir");
}
else if(command == "lsall")
{
cout<<""<<endl;
system("dir/a");
}
else if(command == "ip")
{
system("ipconfig");
}
else if(command == "ipfix")
{

system("start ipfix.bat");
}
else if(command == "clear")
{
system("cls");
}
else if(command =="rm")
{
command = input.substr(0, pos);
argument = input.substr(pos+1);
if( remove( argument.c_str() )!= 0 )
{
cerr << "Error deleting file, argument:" << argument;
}
else
{
cout<< "File successfully deleted" ;
}
}
else if(command == "rname")
{
command = input.substr(0, pos);
int pos2= input.find(" ", pos+1);
string oldname = input.substr(pos+1, pos2-pos);
string newname = input.substr(pos2+1);
//their code
int result;
result= rename( oldname.c_str() , newname.c_str () );
if ( result == 0 )
cout<< "File successfully renamed"<<endl;
else
cerr << "Error renaming file, argument:" << argument;
}
else if(command == "echo")
{
int pos2= input.find(">");
ofstream outfile;
argument = input.substr(pos+1);
outfile.open(input.substr(pos2+1).c_str());
outfile << input.substr(pos+1, pos2-(pos+1));
outfile.close();
}
else if (command =="cd")
{
// DirectoryInfo di = new DirectoryInfo("test");
// di.Attributes |= FileAttributes.ReadOnly;
//if(pos == string::npos)
//{
system("cd");
//}
//else
//{
// argument = input.substr(pos);
// cout << "command running: " << command+argument << endl;
// system((command + argument).c_str());
//}
}
else if (command == "move")
{

int pos2= input.find(" ", pos+1);
argument = input.substr(pos+1);
//system("move");
system ((command +" "+ argument).c_str());
}
else if (command == "mkdir")
{
int pos2= input.find(" ", pos+1);
argument = input.substr(pos+1);
//system("mkdir")
system ((command +" "+ argument).c_str());
}
else if (command == "rmdir")
{
int pos2= input.find(" ", pos+1);
argument = input.substr(pos+1);
//system("rmdir")
system ((command +" "+ argument).c_str());
}
else if(command == "shutl")
{
cout<<""<<endl;
cout <<"Different Ways to shutdown."<<endl;
cout<<""<<endl;
cout<<"shutf immediatlly shutdowns the computer"<<endl;
}
else if(command == "shutf")
{
system("shutdown /f");
}
else if(command == "td")
{
cout<<""<<endl;
cout <<"DATE: " << date << endl;
cout <<"TIME: " << time << endl;
cout<<""<<endl;
}
else if(command == "note")
{
system("START /MAX NOTEPAD");
}
else if(command == "browse")
{
//string b;
//cout<<" Enter Your Search Here"<<endl;
//cin>>b;
//call "C:\Program Files\Internet Explorer\iexplore.exe" "b"
}
else if (command == "tips")
{
cout<<""<<endl;
cout<<"1. Hit F7 to see a list of usefull commands"<<endl;
cout<<"2. Type in shutl to see a list of shutdown commands"<<endl;
cout<<"3. Type in cac to get to a command line based caculator"<<endl;
}
else if (command == "help" | command == "/?" | command == "?" | command == "commands")
{
cout <<"" <<endl;
cout <<"Here is the list of all of the commands that this shell has so far.." <<endl;
cout <<"" <<endl;
cout <<" TIPS Displays a list of usefull commands"<<endl;
cout <<" SHUTL lists a couple of different ways to shutdown"<<endl;
cout <<" CAT Can read files" <<endl;
cout <<" NOTE Opens notepad"<<endl;
cout <<" ECHO Can write or edit files" <<endl;
cout <<" RM Deletes a file permanantly"<<endl;
cout <<" RNAME Renames a certain file"<<endl;
cout <<" TD Displays the time and date"<<endl;
cout <<" LS A list of the contents inside directory" <<endl;
cout <<" LSALL Displays all the files, including hidden, in the current directory"<<endl;
cout <<" MOVE Moves a file to a folder"<<endl;
cout <<" MKDIR Makes a new folder in current Directory"<<endl;
cout <<" RMDIR Removes a direcotry (/s to remove everthing in direcoty"<<endl;
cout <<" CD Displays the address of the current directory" <<endl;
cout <<" IP Displays your ip adderess and subnet mask" <<endl;
cout <<" IPFIX Renews your ip addres which usually fixes the problem" <<endl;
cout <<" CLEAR Clears the screen" <<endl;
cout <<" HELP Displays a list of commands working on v.1.0"<<endl;
cout <<" EXIT Exits the shell immediately" <<endl;
}

else
{
system("color 0c");
cout << "This command is not recognized by this shell."<<endl;
cout << "Type in help to see a list of commands.";
cout << "\a";
cout << "\a";
cout << "\a"<<endl;
system("PAUSE");
system("color 07");
}
}
}


ok so compile that and when u type in a username such as justin and password as amdin.. it should work and it does it enables u to use the shell but.. it thinks its an uknown command...????

Reply With Quote
  #12  
Old August 20th, 2007, 06:31 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
Ok, first of all, string comparison is case sensitive. So in this case it only work with lowercase commands.
Second, the code for extracting a command from the input stream does not always work properly. Try for instance to type nothing and just press enter. These two statements:
Code:
int pos = input.find(" ");
command = input.substr(0, pos);

will return an empty string. That's why you get an 'unknown command'. The same thing happens after you login, I think a newline is still pending in the outputstream.

You could do something like:
Code:
int pos = input.find(" ");
command = input.substr(0, pos);
if( command == "" ) continue;


Offcourse there are a lot of other ways to handle it than the above suggestion. If find() returns std::string::npos, that means the character has not been found, you might want to handle that event properly instead.

Good luck

Reply With Quote
  #13  
Old August 20th, 2007, 10:22 AM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
get this gay error..

.\login.cpp(60) : error C2044: illegal continue

Reply With Quote
  #14  
Old August 20th, 2007, 10:48 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
hmm line 60 is the while loop in my code.. Did you change anything else?

Reply With Quote
  #15  
Old August 20th, 2007, 01:26 PM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
Quote:
Originally Posted by Icon
hmm line 60 is the while loop in my code.. Did you change anything else?

no...also i put the code above my while loop...

Reply With Quote
  #16  
Old August 20th, 2007, 02:52 PM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
Continue can only be used inside a loop (and with labels?). If you cannot fix it you can post your _exact_ code again and i'll see if I can fix it.

Reply With Quote
  #17  
Old August 21st, 2007, 02:06 AM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
//JUSTIN'S E-SHELL CODE
#include <iostream>
#include <fstream>
#include <string>
#include <cstdio>
#include <ctime>
using namespace std;

int main()
{
char dateStr[9];
_strdate_s(dateStr, 9);
string date = dateStr;
char timeStr[9];
_strtime_s(timeStr, 9);
string time = timeStr;
string command ;
string argument;
string input;
ifstream infile;
string cat;
cout << "Justin Edelson Corporation E-SHELL [v.2.0]"<<endl;
cout << "<C> Copy Right 2007 All Rights Reserved"<<endl;
cout<<""<<endl;
string user = "Guest";
//cout<<"Logged in as: "<<user<<endl;
// cout <<"DATE: " << date << endl;
// cout <<"TIME: " << time << endl;
string pass1 = "admin";
string users1 = "justin";
string users2 = "admin";
string pass2 = "admin";
string password;
string users;
int z = 0;
cout<<""<<endl;
system("title E-SHELL");
cout<<""<<endl;
cout<<"Username: ";
cin>>users;
cout<<"Password: ";
cin>>password;
if(users == users1 | users == users2)
{
z=z+1;
}
if(password == pass1 | password == pass2)
{
z=z+1;
}
if(z==2)
{
cout<<""<<endl;
string user = users;
system("color 07");
cout<<"Logged in as: "<<user<<endl;
}


while(z==2)
{

cout<<""<<endl;
cout << "E-SHELL v.2.0> ";
getline(cin, input);
int pos = input.find(" ");
command = input.substr(0, pos);
if( command == "" ) continue;
if(command == "cat")
{
argument = input.substr(pos+1);
infile.open(argument.c_str());

if (!infile.is_open())
{
cerr <<"Could not open file.\n";
exit(-1);
}
//do cat code heren (just a while loop with getline)
while(getline(infile, cat))
{
cout<<""<<endl;
cout << cat << endl;
}
}
else if(command == "exit")
{
exit(0);
}
else if(command == "ls")
{
cout<<""<<endl;
cout<<"Add all to see hidden files"<<endl;
cout<<""<<endl;
system("dir");
}
else if(command == "lsall")
{
cout<<""<<endl;
system("dir/a");
}
else if(command == "ip")
{
system("ipconfig");
}
else if(command == "ipfix")
{

system("start ipfix.bat");
}
else if(command == "clear")
{
system("cls");
}
else if(command =="rm")
{
command = input.substr(0, pos);
argument = input.substr(pos+1);
if( remove( argument.c_str() )!= 0 )
{
cerr << "Error deleting file, argument:" << argument;
}
else
{
cout<< "File successfully deleted" ;
}
}
else if(command == "rname")
{
command = input.substr(0, pos);
int pos2= input.find(" ", pos+1);
string oldname = input.substr(pos+1, pos2-pos);
string newname = input.substr(pos2+1);
//their code
int result;
result= rename( oldname.c_str() , newname.c_str () );
if ( result == 0 )
cout<< "File successfully renamed"<<endl;
else
cerr << "Error renaming file, argument:" << argument;
}
else if(command == "echo")
{
int pos2= input.find(">");
ofstream outfile;
argument = input.substr(pos+1);
outfile.open(input.substr(pos2+1).c_str());
outfile << input.substr(pos+1, pos2-(pos+1));
outfile.close();
}
else if (command =="cd")
{
// DirectoryInfo di = new DirectoryInfo("test");
// di.Attributes |= FileAttributes.ReadOnly;
//if(pos == string::npos)
//{
system("cd");
//}
//else
//{
// argument = input.substr(pos);
// cout << "command running: " << command+argument << endl;
// system((command + argument).c_str());
//}
}
else if (command == "move")
{

int pos2= input.find(" ", pos+1);
argument = input.substr(pos+1);
//system("move");
system ((command +" "+ argument).c_str());
}
else if (command == "mkdir")
{
int pos2= input.find(" ", pos+1);
argument = input.substr(pos+1);
//system("mkdir")
system ((command +" "+ argument).c_str());
}
else if (command == "rmdir")
{
int pos2= input.find(" ", pos+1);
argument = input.substr(pos+1);
//system("rmdir")
system ((command +" "+ argument).c_str());
}
else if(command == "shutl")
{
cout<<""<<endl;
cout <<"Different Ways to shutdown."<<endl;
cout<<""<<endl;
cout<<"shutf immediatlly shutdowns the computer"<<endl;
}
else if(command == "shutf")
{
system("shutdown /f");
}
else if(command == "td")
{
cout<<""<<endl;
cout <<"DATE: " << date << endl;
cout <<"TIME: " << time << endl;
cout<<""<<endl;
}
else if(command == "note")
{
system("START /MAX NOTEPAD");
}
else if(command == "browse")
{
//string b;
//cout<<" Enter Your Search Here"<<endl;
//cin>>b;
//call "C:\Program Files\Internet Explorer\iexplore.exe" "b"
}
else if (command == "tips")
{
cout<<""<<endl;
cout<<"1. Hit F7 to see a list of usefull commands"<<endl;
cout<<"2. Type in shutl to see a list of shutdown commands"<<endl;
cout<<"3. Type in cac to get to a command line based caculator"<<endl;
}
else if (command == "help" | command == "/?" | command == "?" | command == "commands")
{
cout <<"" <<endl;
cout <<"Here is the list of all of the commands that this shell has so far.." <<endl;
cout <<"" <<endl;
cout <<" TIPS Displays a list of usefull commands"<<endl;
cout <<" SHUTL lists a couple of different ways to shutdown"<<endl;
cout <<" CAT Can read files" <<endl;
cout <<" NOTE Opens notepad"<<endl;
cout <<" ECHO Can write or edit files" <<endl;
cout <<" RM Deletes a file permanantly"<<endl;
cout <<" RNAME Renames a certain file"<<endl;
cout <<" TD Displays the time and date"<<endl;
cout <<" LS A list of the contents inside directory" <<endl;
cout <<" LSALL Displays all the files, including hidden, in the current directory"<<endl;
cout <<" MOVE Moves a file to a folder"<<endl;
cout <<" MKDIR Makes a new folder in current Directory"<<endl;
cout <<" RMDIR Removes a direcotry (/s to remove everthing in direcoty"<<endl;
cout <<" CD Displays the address of the current directory" <<endl;
cout <<" IP Displays your ip adderess and subnet mask" <<endl;
cout <<" IPFIX Renews your ip addres which usually fixes the problem" <<endl;
cout <<" CLEAR Clears the screen" <<endl;
cout <<" HELP Displays a list of commands working on v.1.0"<<endl;
cout <<" EXIT Exits the shell immediately" <<endl;
}

else
{
system("color 0c");
cout << "This command is not recognized by this shell."<<endl;
cout << "Type in help to see a list of commands.";
cout << "\a";
cout << "\a";
cout << "\a"<<endl;
system("PAUSE");
system("color 07");
}
}
}



ok try it and when u login correctly it dosnt say eror just two lines appear??

Reply With Quote
  #18  
Old August 21st, 2007, 03:59 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
You could do something like this, but it is up to you:

cpp Code:
Original - cpp Code
  1. //JUSTIN'S E-SHELL CODE
  2. #include <iostream>
  3. #include <fstream>
  4. #include <string>
  5. #include <cstdio>
  6. #include <ctime>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.    char dateStr[9];
  12.    _strdate_s(dateStr, 9);
  13.    string date = dateStr;
  14.    char timeStr[9];
  15.    _strtime_s(timeStr, 9);
  16.    string time = timeStr;
  17.    string command ;
  18.    string argument;
  19.    string input;
  20.    ifstream infile;
  21.    string cat;
  22.    cout << "Justin Edelson Corporation E-SHELL [v.2.0]"<<endl;
  23.    cout << "<C> Copy Right 2007 All Rights Reserved"<<endl;
  24.    cout<<""<<endl;
  25.    string user = "Guest";
  26.    //cout<<"Logged in as: "<<user<<endl;
  27.    // cout <<"DATE: " << date << endl;
  28.    // cout <<"TIME: " << time << endl;
  29.    string pass1 = "admin";
  30.    string users1 = "justin";
  31.    string users2 = "admin";
  32.    string pass2 = "admin";
  33.    string password;
  34.    string users;
  35.    int z = 0;
  36.    cout<<""<<endl;
  37.    system("title E-SHELL");
  38.    cout<<""<<endl;
  39.    cout<<"Username: ";
  40.    cin>>users;
  41.    cout<<"Password: ";
  42.    cin>>password;
  43.    if(users == users1 | users == users2)
  44.    {
  45.       z=z+1;
  46.    }
  47.    if(password == pass1 | password == pass2)
  48.    {
  49.       z=z+1;
  50.    }
  51.    if(z==2)
  52.    {
  53.       cout<<""<<endl;
  54.       string user = users;
  55.       system("color 07");
  56.       cout<<"Logged in as: "<<user<<endl;
  57.    }
  58.  
  59.  
  60.    cout<<""<<endl;
  61.    cout << "E-SHELL v.2.0> ";
  62.    getline(cin, input); // read the remaining newline
  63.  
  64.    while(z==2)
  65.    {
  66.  
  67.       getline(cin, input);
  68.       int pos = input.find(" ");
  69.       command = input.substr(0, pos);
  70.       if(command == "" )
  71.       {
  72.          // noop
  73.       }
  74.       else if(command == "cat")
  75.       {
  76.          argument = input.substr(pos+1);
  77.          infile.open(argument.c_str());
  78.  
  79.          if (!infile.is_open())
  80.          {
  81.             cerr <<"Could not open file.\n";
  82.             exit(-1);
  83.          }
  84.          //do cat code heren (just a while loop with getline)
  85.          while(getline(infile, cat))
  86.          {
  87.             cout<<""<<endl;
  88.             cout << cat << endl;
  89.          }
  90.       }
  91.       else if(command == "exit")
  92.       {
  93.          exit(0);
  94.       }
  95.       else if(command == "ls")
  96.       {
  97.          cout<<""<<endl;
  98.          cout<<"Add all to see hidden files"<<endl;
  99.          cout<<""<<endl;
  100.          system("dir");
  101.       }
  102.       else if(command == "lsall")
  103.       {
  104.          cout<<""<<endl;
  105.          system("dir/a");
  106.       }
  107.       else if(command == "ip")
  108.       {
  109.          system("ipconfig");
  110.       }
  111.       else if(command == "ipfix")
  112.       {
  113.  
  114.          system("start ipfix.bat");
  115.       }
  116.       else if(command == "clear")
  117.       {
  118.          system("cls");
  119.       }
  120.       else if(command =="rm")
  121.       {
  122.          command = input.substr(0, pos);
  123.          argument = input.substr(pos+1);
  124.          if( remove( argument.c_str() )!= 0 )
  125.          {
  126.             cerr << "Error deleting file, argument:" << argument;
  127.          }
  128.          else
  129.          {
  130.             cout<< "File successfully deleted" ;
  131.          }
  132.       }
  133.       else if(command == "rname")
  134.       {
  135.          command = input.substr(0, pos);
  136.          int pos2= input.find(" ", pos+1);
  137.          string oldname = input.substr(pos+1, pos2-pos);
  138.          string newname = input.substr(pos2+1);
  139.          //their code
  140.          int result;
  141.          result= rename( oldname.c_str() , newname.c_str () );
  142.          if ( result == 0 )
  143.             cout<< "File successfully renamed"<<endl;
  144.          else
  145.             cerr << "Error renaming file, argument:" << argument;
  146.       }
  147.       else if(command == "echo")
  148.       {
  149.          int pos2= input.find(">");
  150.          ofstream outfile;
  151.          argument = input.substr(pos+1);
  152.          outfile.open(input.substr(pos2+1).c_str());
  153.          outfile << input.substr(pos+1, pos2-(pos+1));
  154.          outfile.close();
  155.       }
  156.       else if (command =="cd")
  157.       {
  158.          // DirectoryInfo di = new DirectoryInfo("test");
  159.          // di.Attributes |= FileAttributes.ReadOnly;
  160.          //if(pos == string::npos)
  161.          //{
  162.          system("cd");
  163.          //}
  164.          //else
  165.          //{
  166.          // argument = input.substr(pos);
  167.          // cout << "command running: " << command+argument << endl;
  168.          // system((command + argument).c_str());
  169.          //}
  170.       }
  171.       else if (command == "move")
  172.       {
  173.  
  174.          int pos2= input.find(" ", pos+1);
  175.          argument = input.substr(pos+1);
  176.          //system("move");
  177.          system ((command +" "+ argument).c_str());
  178.       }
  179.       else if (command == "mkdir")
  180.       {
  181.          int pos2= input.find(" ", pos+1);
  182.          argument = input.substr(pos+1);
  183.          //system("mkdir")
  184.          system ((command +" "+ argument).c_str());
  185.       }
  186.       else if (command == "rmdir")
  187.       {
  188.          int pos2= input.find(" ", pos+1);
  189.          argument = input.substr(pos+1);
  190.          //system("rmdir")
  191.          system ((command +" "+ argument).c_str());
  192.       }
  193.       else if(command == "shutl")
  194.       {
  195.          cout<<""<<endl;
  196.          cout <<"Different Ways to shutdown."<<endl;
  197.          cout<<""<<endl;
  198.          cout<<"shutf immediatlly shutdowns the computer"<<endl;
  199.       }
  200.       else if(command == "shutf")
  201.       {
  202.          system("shutdown /f");
  203.       }
  204.       else if(command == "td")
  205.       {
  206.          cout<<""<<endl;
  207.          cout <<"DATE: " << date << endl;
  208.          cout <<"TIME: " << time << endl;
  209.          cout<<""<<endl;
  210.       }
  211.       else if(command == "note")
  212.       {
  213.          system("START /MAX NOTEPAD");
  214.       }
  215.       else if(command == "browse")
  216.       {
  217.          //string b;
  218.          //cout<<" Enter Your Search Here"<<endl;
  219.          //cin>>b;
  220.          //call "C:\Program Files\Internet Explorer\iexplore.exe" "b"
  221.       }
  222.       else if (command == "tips")
  223.       {
  224.          cout<<""<<endl;
  225.          cout<<"1. Hit F7 to see a list of usefull commands"<<endl;
  226.          cout<<"2. Type in shutl to see a list of shutdown commands"<<endl;
  227.          cout<<"3. Type in cac to get to a command line based caculator"<<endl;
  228.       }
  229.       else if (command == "help" | command == "/?" | command == "?" | command == "commands")
  230.       {
  231.          cout <<"" <<endl;
  232.          cout <<"Here is the list of all of the commands that this shell has so far.." <<endl;
  233.          cout <<"" <<endl;
  234.          cout <<" TIPS Displays a list of usefull commands"<<endl;
  235.          cout <<" SHUTL lists a couple of different ways to shutdown"<<endl;
  236.          cout <<" CAT Can read files" <<endl;
  237.          cout <<" NOTE Opens notepad"<<endl;
  238.          cout <<" ECHO Can write or edit files" <<endl;
  239.          cout <<" RM Deletes a file permanantly"<<endl;
  240.          cout <<" RNAME Renames a certain file"<<endl;
  241.          cout <<" TD Displays the time and date"<<endl;
  242.          cout <<" LS A list of the contents inside directory" <<endl;
  243.          cout <<" LSALL Displays all the files, including hidden, in the current directory"<<endl;
  244.          cout <<" MOVE Moves a file to a folder"<<endl;
  245.          cout <<" MKDIR Makes a new folder in current Directory"<<endl;
  246.          cout <<" RMDIR Removes a direcotry (/s to remove everthing in direcoty"<<endl;
  247.          cout <<" CD Displays the address of the current directory" <<endl;
  248.          cout <<" IP Displays your ip adderess and subnet mask" <<endl;
  249.          cout <<" IPFIX Renews your ip addres which usually fixes the problem" <<endl;
  250.          cout <<" CLEAR Clears the screen" <<endl;
  251.          cout <<" HELP Displays a list of commands working on v.1.0"<<endl;
  252.          cout <<" EXIT Exits the shell immediately" <<endl;
  253.       }
  254.  
  255.       else
  256.       {
  257.          system("color 0c");
  258.          cout << "This command is not recognized by this shell."<<endl;
  259.          cout << "Type in help to see a list of commands.";
  260.          cout << "\a";
  261.          cout << "\a";
  262.          cout << "\a"<<endl;
  263.          system("PAUSE");
  264.          system("color 07");
  265.       }
  266.  
  267.       cout<<""<<endl;
  268.       cout << "E-SHELL v.2.0> ";
  269.    }
  270.  
  271.    return 0;
  272. }


You should probably restructure your program if you want it to be maintainable.

Reply With Quote
  #19  
Old August 21st, 2007, 05:07 AM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
ok that wrked but what did u change.. and y did u put its up to me.. wat did u get rid of?

Reply With Quote
  #20  
Old August 21st, 2007, 06:10 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
Look at line 62 of the code I posted and I also added a command == "" case.

Why I said that it is up to you is because there are multiple ways to fix things like this. I'm just giving you a hint, it is up to you to find out what you will do in the end because you know what you want to do with this program.

Reply With Quote
  #21  
Old August 21st, 2007, 11:09 AM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
Quote:
Originally Posted by Icon
Look at line 62 of the code I posted and I also added a command == "" case.

Why I said that it is up to you is because there are multiple ways to fix things like this. I'm just giving you a hint, it is up to you to find out what you will do in the end because you know what you want to do with this program.

ok cool ty

Reply With Quote
  #22  
Old August 21st, 2007, 03:04 PM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
yo could u help me to so if the password an username are true (boleen) it continues but if FALSE it says like wrong password or username... i forgot how to do that...with boleens

Reply With Quote
  #23  
Old August 22nd, 2007, 03:51 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
Ok I hacked this up in 10 minutes this morning, no guarantees

cpp Code:
Original - cpp Code
  1. #include <iostream>
  2. #include <string>
  3. #include <map>
  4. using namespace std;
  5.  
  6. class Authentication
  7. {
  8. public:
  9.    typedef map<string, string> UserList;
  10.  
  11.    Authentication()
  12.    {
  13.       initUserList();
  14.    }
  15.  
  16.    virtual ~Authentication() {}
  17.  
  18.    virtual bool userExists(string username)
  19.    {
  20.       return _userList.count(username) > 0;
  21.    }
  22.  
  23.    virtual bool checkAccess(string username, string password)
  24.    {
  25.       return userExists(username) && _userList[username] == password;
  26.    }
  27.  
  28. protected:
  29.    // noncopyable
  30.    Authentication(const Authentication& a);
  31.    Authentication& operator= (const Authentication& a);
  32.  
  33. private:
  34.    void initUserList()
  35.    {
  36.       _userList.clear();
  37.  
  38.       // maybe get this from an encrypted file or database
  39.       _userList.insert( make_pair("justin", "admin") );
  40.       _userList.insert( make_pair("admin", "admin") );
  41.       _userList.insert( make_pair("guest", "") );
  42.    }
  43.  
  44.    UserList _userList;
  45. };
  46.  
  47. int main()
  48. {
  49.    string user;
  50.    string password;
  51.  
  52.    cout << "Username: ";
  53.    cin >> user;
  54.    cout << "Password: ";
  55.    cin >> password;
  56.  
  57.    Authentication auth;
  58.  
  59.    if( !auth.userExists(user) )
  60.    {
  61.       cout << "User not found\n";
  62.    }
  63.    else // user does exist
  64.    {
  65.       if( !auth.checkAccess(user, password) )
  66.       {
  67.          cout << "Wrong password\n";
  68.       }
  69.       else
  70.       {
  71.          cout << "Access granted\n";
  72.       }
  73.    }
  74.  
  75.    system("pause");
  76. }

Reply With Quote
  #24  
Old August 22nd, 2007, 12:50 PM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
Code:
//JUSTIN'S E-SHELL CODE
#include <iostream>
#include <fstream>
#include <string>
#include <cstdio>
#include <ctime>
#include <map>
using namespace std;

class Authentication
{
public:
   typedef map<string, string> UserList;

   Authentication()
   {
      initUserList();
   }

   virtual ~Authentication() {}

   virtual bool userExists(string username)
   {
      return _userList.count(username) > 0;
   }

   virtual bool checkAccess(string username, string password)
   {
      return userExists(username) && _userList[username] == password;
   }

protected:
   // noncopyable
   Authentication(const Authentication& a);
   Authentication& operator= (const Authentication& a);

private:
   void initUserList()
   {
      _userList.clear();

      // maybe get this from an encrypted file or database
      _userList.insert( make_pair("justin", "admin") );
      _userList.insert( make_pair("admin", "admin") );
      _userList.insert( make_pair("guest", "") );
   }

   UserList _userList;
};

int main()
{
   char dateStr[9];
   _strdate_s(dateStr, 9);
   string date = dateStr;
   char timeStr[9];
   _strtime_s(timeStr, 9);
   string time = timeStr;
   string command ;
   string argument;
   string input;
   ifstream infile;
   string cat;
   cout << "Justin Edelson Corporation E-SHELL [v.2.0]"<<endl;
   cout << "<C> Copy Right 2007 All Rights Reserved"<<endl;
   cout<<""<<endl;
   //string user = "Guest";
   int z = 0;
   //cout<<"Logged in as: "<<user<<endl;
   // cout <<"DATE: " << date << endl; 
   // cout <<"TIME: " << time << endl; 
  /* string pass1 = "admin";
   string users1 = "justin";
   string users2 = "admin";
   string pass2 = "admin";
   string password;
   string users;
   int z = 0;
   cout<<""<<endl;
   system("title E-SHELL");
   cout<<""<<endl;
   cout<<"Username: ";
   cin>>users;
   cout<<"Password: ";
   cin>>password;
   if(users == users1 | users == users2)
   {
      z=z+1;
   }
   if(password == pass1 | password == pass2)
   {
      z=z+1;
   }
   if(z==2)
   {
      cout<<""<<endl;
      string user = users;
      system("color 07");
      cout<<"Logged in as: "<<user<<endl;
   }
//	if(z!=2)
//	{
//		cout>>"sorry";
//	}
*/
   cout<<""<<endl;
   cout << "E-SHELL v.2.0> ";
   getline(cin, input); // read the remaining newline
   string user;
   string password;

   cout << "Username: ";
   cin >> user;
   cout << "Password: ";
   cin >> password;

   Authentication auth;

   if( !auth.userExists(user) )
   {
      cout << "User not found\n";
   }
   else // user does exist
   {
      if( !auth.checkAccess(user, password) )
      {
         cout << "Wrong password\n";
      }
      else
      {
         cout << "Access granted\n";
		 z=2;
      }

   while(z==2)
   {

      getline(cin, input);
      int pos = input.find(" ");
      command = input.substr(0, pos);
      if(command == "" )
      {
         // noop
      }
      else if(command == "cat")
      {
         argument = input.substr(pos+1);
         infile.open(argument.c_str());

         if (!infile.is_open())
         {
            cerr <<"Could not open file.\n";
            exit(-1);
         }
         //do cat code heren (just a while loop with getline)
         while(getline(infile, cat))
         {
            cout<<""<<endl;
            cout << cat << endl;
         }
      }
      else if(command == "exit")
      {
         exit(0);
      }
      else if(command == "ls")
      {
         cout<<""<<endl;
         cout<<"Add all to see hidden files"<<endl;
         cout<<""<<endl;
         system("dir"); 
      }
      else if(command == "lsall")
      {
         cout<<""<<endl;
         system("dir/a");
      }
      else if(command == "ip")
      {
         system("ipconfig");
      }
      else if(command == "ipfix")
      {

         system("start ipfix.bat");
      }
      else if(command == "clear")
      {
         system("cls");
      }
      else if(command =="rm")
      {
         command = input.substr(0, pos);
         argument = input.substr(pos+1);
         if( remove( argument.c_str() )!= 0 )
         {
            cerr << "Error deleting file, argument:" << argument;
         }
         else
         {
            cout<< "File successfully deleted" ;
         }
      }
      else if(command == "rname")
      {
         command = input.substr(0, pos);
         int pos2= input.find(" ", pos+1);
         string oldname = input.substr(pos+1, pos2-pos);
         string newname = input.substr(pos2+1);
         //their code
         int result;
         result= rename( oldname.c_str() , newname.c_str () );
         if ( result == 0 )
            cout<< "File successfully renamed"<<endl;
         else
            cerr << "Error renaming file, argument:" << argument;
      }
      else if(command == "echo")
      {
         int pos2= input.find(">");
         ofstream outfile;
         argument = input.substr(pos+1);
         outfile.open(input.substr(pos2+1).c_str());
         outfile << input.substr(pos+1, pos2-(pos+1));
         outfile.close();
      }
      else if (command =="cd")
      {
         // DirectoryInfo di = new DirectoryInfo("test");
         // di.Attributes |= FileAttributes.ReadOnly; 
         //if(pos == string::npos)
         //{
         system("cd");
         //}
         //else
         //{
         // argument = input.substr(pos);
         // cout << "command running: " << command+argument << endl;
         // system((command + argument).c_str());
         //}
      }
      else if (command == "move")
      {

         int pos2= input.find(" ", pos+1); 
         argument = input.substr(pos+1);
         //system("move");
         system ((command +" "+ argument).c_str());
      }
      else if (command == "mkdir")
      {
         int pos2= input.find(" ", pos+1); 
         argument = input.substr(pos+1);
         //system("mkdir")
         system ((command +" "+ argument).c_str());
      }
      else if (command == "rmdir")
      {
         int pos2= input.find(" ", pos+1); 
         argument = input.substr(pos+1);
         //system("rmdir")
         system ((command +" "+ argument).c_str());
      }
      else if(command == "shutl")
      {
         cout<<""<<endl;
         cout <<"Different Ways to shutdown."<<endl;
         cout<<""<<endl;
         cout<<"shutf immediatlly shutdowns the computer"<<endl;
      }
      else if(command == "shutf")
      {
         system("shutdown /f");
      }
      else if(command == "td")
      {
         cout<<""<<endl;
         cout <<"DATE: " << date << endl; 
         cout <<"TIME: " << time << endl; 
         cout<<""<<endl;
      }
      else if(command == "note")
      {
         system("START /MAX NOTEPAD");
      }
      else if(command == "browse")
      {
         //string b;
         //cout<<" Enter Your Search Here"<<endl;
         //cin>>b;
         //call "C:\Program Files\Internet Explorer\iexplore.exe" "b"
      }
      else if (command == "tips")
      {
         cout<<""<<endl;
         cout<<"1. Hit F7 to see a list of usefull commands"<<endl;
         cout<<"2. Type in shutl to see a list of shutdown commands"<<endl;
         cout<<"3. Type in cac to get to a command line based caculator"<<endl;
      }
      else if (command == "help" | command == "/?" | command == "?" | command == "commands")
      {
         cout <<"" <<endl;
         cout <<"Here is the list of all of the commands that this shell has so far.." <<endl;
         cout <<"" <<endl;
         cout <<" TIPS	Displays a list of usefull commands"<<endl;
         cout <<" SHUTL	lists a couple of different ways to shutdown"<<endl;
         cout <<" CAT	Can read files" <<endl;
         cout <<" NOTE	Opens notepad"<<endl;
         cout <<" ECHO	Can write or edit files" <<endl;
         cout <<" RM	Deletes a file permanantly"<<endl;
         cout <<" RNAME	Renames a certain file"<<endl;
         cout <<" TD	Displays the time and date"<<endl;
         cout <<" LS	A list of the contents inside directory" <<endl;
         cout <<" LSALL	Displays all the files, including hidden, in the current directory"<<endl;
         cout <<" MOVE	Moves a file to a folder"<<endl;
         cout <<" MKDIR	Makes a new folder in current Directory"<<endl;
         cout <<" RMDIR	Removes a direcotry (/s to remove everthing in direcoty"<<endl;
         cout <<" CD	Displays the address of the current directory" <<endl;
         cout <<" IP	Displays your ip adderess and subnet mask" <<endl;
         cout <<" IPFIX	Renews your ip addres which usually fixes the problem" <<endl;
         cout <<" CLEAR	Clears the screen" <<endl;
         cout <<" HELP	Displays a list of commands working on v.1.0"<<endl;
         cout <<" EXIT	Exits the shell immediately" <<endl;
      }

      else
      {
         system("color 0c");
         cout << "This command is not recognized by this shell."<<endl;
         cout << "Type in help to see a list of commands.";
         cout << "\a";
         cout << "\a";
         cout << "\a"<<endl;
         system("PAUSE");
         system("color 07");
      }

      cout<<""<<endl;
      cout << "E-SHELL v.2.0> ";
  }

   return 0;
}



i got this error when rying to intergrate it into my shell..it wrked fine by itsself though! ;-)


------ Build started: Project: login_e-shell, Configuration: Debug Win32 ------
Compiling...
login.cpp
.\login.cpp(344) : fatal error C1075: end of file found before the left brace '{' at '.\login.cpp(52)' was matched
Build log was saved at "file://c:\Documents and Settings\Justin Edelson\My Documents\Visual Studio 2005\Projects\login_e-shell\login_e-shell\Debug\BuildLog.htm"
login_e-shell - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Reply With Quote
  #25  
Old August 22nd, 2007, 04:34 PM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
Add an extra } at the end of the file.

Reply With Quote
  #26  
Old August 23rd, 2007, 06:36 PM
justinede justinede is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 35 justinede User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 51 sec
Reputation Power: 11
Code:
//JUSTIN'S E-SHELL CODE
#include <iostream>
#include <fstream>
#include <string>
#include <cstdio>
#include <ctime>
#include <map>
using namespace std;

class Authentication
{
public:
   typedef map<string, string> UserList;

   Authentication()
   {
      initUserList();
   }

   virtual ~Authentication() {}

   virtual bool userExists(string username)
   {
      return _userList.count(username) > 0;
   }

   virtual bool checkAccess(string username, string password)
   {
      return userExists(username) && _userList[username] == password;
   }

protected:
   // noncopyable
   Authentication(const Authentication& a);
   Authentication& operator= (const Authentication& a);

private:
   void initUserList()
   {
      _userList.clear();

      // maybe get this from an encrypted file or database
      _userList.insert( make_pair("justin", "admin") );
      _userList.insert( make_pair("admin", "admin") );
      _userList.insert( make_pair("guest", "") );
   }

   UserList _userList;
};

int main()
{
   char dateStr[9];
   _strdate_s(dateStr, 9);
   string date = dateStr;
   char timeStr[9];
   _strtime_s(timeStr, 9);
   string time = timeStr;
   string command ;
   string argument;
   string input;
   ifstream infile;
   string cat;
   cout << "Justin Edelson Corporation E-SHELL [v.2.0]"<<endl;
   cout << "<C> Copy Right 2007 All Rights Reserved"<<endl;
   cout<<""<<endl;
   //string user = "Guest";
   int z = 0;
   //cout<<"Logged in as: "<<user<<endl;
   // cout <<"DATE: " << date << endl; 
   // cout <<"TIME: " << time << endl; 
  /* string pass1 = "admin";
   string users1 = "justin";
   string users2 = "admin";
   string pass2 = "admin";
   string password;
   string users;
   int z = 0;
   cout<<""<<endl;
   system("title E-SHELL");
   cout<<""<<endl;
   cout<<"Username: ";
   cin>>users;
   cout<<"Password: ";
   cin>>password;
   if(users == users1 | users == users2)
   {
      z=z+1;
   }
   if(password == pass1 | password == pass2)
   {
      z=z+1;
   }
   if(z==2)
   {
      cout<<""<<endl;
      string user = users;
      system("color 07");
      cout<<"Logged in as: "<<user<<endl;
   }
//	if(z!=2)
//	{
//		cout>>"sorry";
//	}
*/


   cout << "Username: ";
   cin >> user;
   cout << "Password: ";
   cin >> password;

   Authentication auth;

   if( !auth.userExists(user) )
   {
      cout << "User not found\n";
   }
   else // user does exist
   {
      if( !auth.checkAccess(user, password) )
      {
         cout << "Wrong password\n";
      }
      else
      {
         cout << "Access granted\n";
		 z=2;
      }

	     cout<<""<<endl;
   cout << "E-SHELL v.2.0> ";
   getline(cin, input); // read the remaining newline
   string user;
   string password;

   while(z==2)
   {

      getline(cin, input);
      int pos = input.find(" ");
      command = input.substr(0, pos);
      if(command == "" )
      {
         // noop
      }
      else if(command == "cat")
      {
         argument = input.substr(pos+1);
         infile.open(argument.c_str());

         if (!infile.is_open())
         {
            cerr <<"Could not open file.\n";
            exit(-1);
         }
         //do cat code heren (just a while loop with getline)
         while(getline(infile, cat))
         {
            cout<<""<<endl;
            cout << cat << endl;
         }
      }
      else if(command == "exit")
      {
         exit(0);
      }
      else if(command == "ls")
      {
         cout<<""<<endl;
         cout<<"Add all to see hidden files"<<endl;
         cout<<""<<endl;
         system("dir"); 
      }
      else if(command == "lsall")
      {
         cout<<""<<endl;
         system("dir/a");
      }
      else if(command == "ip")
      {
         system("ipconfig");
      }
      else if(command == "ipfix")
      {

         system("start ipfix.bat");
      }
      else if(command == "clear")
      {
         system("cls");
      }
      else if(command =="rm")
      {
         command = input.substr(0, pos);
         argument = input.substr(pos+1);
         if( remove( argument.c_str() )!= 0 )
         {
            cerr << "Error deleting file, argument:" << argument;
         }
         else
         {
            cout<< "File successfully deleted" ;
         }
      }
      else if(command == "rname")
      {
         command = input.substr(0, pos);
         int pos2= input.find(" ", pos+1);
         string oldname = input.substr(pos+1, pos2-pos);
         string newname = input.substr(pos2+1);
         //their code
         int result;
         result= rename( oldname.c_str() , newname.c_str () );
         if ( result == 0 )
            cout<< "File successfully renamed"<<endl;
         else
            cerr << "Error renaming file, argument:" << argument;
      }
      else if(command == "echo")
      {
         int pos2= input.find(">");
         ofstream outfile;
         argument = input.substr(pos+1);
         outfile.open(input.substr(pos2+1).c_str());
         outfile << input.substr(pos+1, pos2-(pos+1));
         outfile.close();
      }
      else if (command =="cd")
      {
         // DirectoryInfo di = new DirectoryInfo("test");
         // di.Attributes |= FileAttributes.ReadOnly; 
         //if(pos == string::npos)
         //{
         system("cd");
         //}
         //else
         //{
         // argument = input.substr(pos);
         // cout << "command running: " << command+argument << endl;
         // system((command + argument).c_str());
         //}
      }
      else if (command == "move")
      {

         int pos2= input.find(" ", pos+1); 
         argument = input.substr(pos+1);
         //system("move");
         system ((command +" "+ argument).c_str());
      }
      else if (command == "mkdir")
      {
         int pos2= input.find(" ", pos+1); 
         argument = input.substr(pos+1);
         //system("mkdir")
         system ((command +" "+ argument).c_str());
      }
      else if (command == "rmdir")
      {
         int pos2= input.find(" ", pos+1); 
         argument = input.substr(pos+1);
         //system("rmdir")
         system ((command +" "+ argument).c_str());
      }
      else if(command == "shutl")
      {
         cout<<""<<endl;
         cout <<"Different Ways to shutdown."<<endl;
         cout<<""<<endl;
         cout<<"shutf immediatlly shutdowns the computer"<<endl;
      }
      else if(command == "shutf")
      {
         system("shutdown /f");
      }
      else if(command == "td")
      {
         cout<<""<<endl;
         cout <<"DATE: " << date << endl; 
         cout <<"TIME: " << time << endl; 
         cout<<""<<endl;
      }
      else if(command == "note")
      {
         system("START /MAX NOTEPAD");
      }
      else if(command == "browse")
      {
         //string b;
         //cout<<" Enter Your Search Here"<<endl;
         //cin>>b;
         //call "C:\Program Files\Internet Explorer\iexplore.exe" "b"
      }
      else if (command == "tips")
      {
         cout<<""<<endl;
         cout<<"1. Hit F7 to see a list of usefull commands"<<endl;
         cout<<"2. Type in shutl to see a list of shutdown commands"<<endl;
         cout<<"3. Type in cac to get to a command line based caculator"<<endl;
      }
      else if (command == "help" | command == "/?" | command == "?" | command == "commands")
      {
         cout <<"" <<endl;
         cout <<"Here is the list of all of the commands that this shell has so far.." <<endl;
         cout <<"" <<endl;
         cout <<" TIPS	Displays a list of usefull commands"<<endl;
         cout <<" SHUTL	lists a couple of different ways to shutdown"<<endl;
         cout <<" CAT	Can read files" <<endl;
         cout <<" NOTE	Opens notepad"<<endl;
         cout <<" ECHO	Can write or edit files" <<endl;
         cout <<" RM	Deletes a file permanantly"<<endl;
         cout <<" RNAME	Renames a certain file"<<endl;
         cout <<" TD	Displays the time and date"<<endl;
         cout <<" LS	A list of the contents inside directory" <<endl;
         cout <<" LSALL	Displays all the files, including hidden, in the current directory"<<endl;
         cout <<" MOVE	Moves a file to a folder"<<endl;
         cout <<" MKDIR	Makes a new folder in current Directory"<<endl;
         cout <<" RMDIR	Removes a direcotry (/s to remove everthing in direcoty"<<endl;
         cout <<" CD	Displays the address of the current directory" <<endl;
         cout <<" IP	Displays your ip adderess and subnet mask" <<endl;
         cout <<" IPFIX	Renews your ip addres which usually fixes the problem" <<endl;
         cout <<" CLEAR	Clears the screen" <<endl;
         cout <<" HELP	Displays a list of commands working on v.1.0"<<endl;
         cout <<" EXIT	Exits the shell immediately" <<endl;
      }

      else
      {
         system("color 0c");
         cout << "This command is not recognized by this shell."<<endl;
         cout << "Type in help to see a list of commands.";
         cout << "\a";
         cout << "\a";
         cout << "\a"<<endl;
         system("PAUSE");
         system("color 07");
      }

      cout<<""<<endl;
      cout << "E-SHELL v.2.0> ";
  }

   return 0;
}
}


------ Build started: Project: login_e-shell, Configuration: Debug Win32 ------
Compiling...
login.cpp
.\login.cpp(109) : error C2065: 'user' : undeclared identifier
.\login.cpp(111) : error C2065: 'password' : undeclared identifier
Build log was saved at "file://c:\Documents and Settings\Justin Edelson\My Documents\Visual Studio 2005\Projects\login_e-shell\login_e-shell\Debug\BuildLog.htm"
login_e-shell - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Reply With Quote
  #27  
Old August 24th, 2007, 03:10 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
You are trying to read a value into user (and password) on line 109, but you are not declaring the variable until line 134 (and 135 for password).

cpp Code:
Original - cpp Code
  1. //JUSTIN'S E-SHELL CODE
  2. #include <iostream>
  3. #include <fstream>
  4. #include <string>
  5. #include <cstdio>
  6. #include <ctime>
  7. #include <map>
  8. using namespace std;
  9.  
  10. class Authentication
  11. {
  12. public:
  13.    typedef map<string, string> UserList;
  14.  
  15.    Authentication()
  16.    {
  17.       initUserList();
  18.    }
  19.  
  20.    virtual ~Authentication() {}
  21.  
  22.    virtual bool userExists(string username)
  23.    {
  24.       return _userList.count(username) > 0;
  25.    }
  26.  
  27.    virtual bool checkAccess(string username, string password)
  28.    {
  29.       return userExists(username) && _userList[username] == password;
  30.    }
  31.  
  32. protected:
  33.    // noncopyable
  34.    Authentication(const Authentication& a);
  35.    Authentication& operator= (const Authentication& a);
  36.  
  37. private:
  38.    void initUserList()
  39.    {
  40.       _userList.clear();
  41.  
  42.       // maybe get this from an encrypted file or database
  43.       _userList.insert( make_pair("justin", "admin") );
  44.       _userList.insert( make_pair("admin", "admin") );
  45.       _userList.insert( make_pair("guest", "") );
  46.    }
  47.  
  48.    UserList _userList;
  49. };
  50.  
  51. int main()
  52. {
  53.    char dateStr[9];
  54.    _strdate_s(dateStr, 9);
  55.    string date = dateStr;
  56.    char timeStr[9];
  57.    _strtime_s(timeStr, 9);
  58.    string time = timeStr;
  59.    string command ;
  60.    string argument;
  61.    string input;
  62.    ifstream infile;
  63.    string cat;
  64.    cout << "Justin Edelson Corporation E-SHELL [v.2.0]"<<endl;
  65.    cout << "<C> Copy Right 2007 All Rights Reserved"<<endl;
  66.    cout<<""<<endl;
  67.    //string user = "Guest";
  68.    int z = 0;
  69.    //cout<<"Logged in as: "<<user<<endl;
  70.    // cout <<"DATE: " << date << endl;
  71.    // cout <<"TIME: " << time << endl;
  72.   /* string pass1 = "admin";
  73.    string users1 = "justin";
  74.    string users2 = "admin";
  75.    string pass2 = "admin";
  76.    string password;
  77.    string users;
  78.    int z = 0;
  79.    cout<<""<<endl;
  80.    system("title E-SHELL");
  81.    cout<<""<<endl;
  82.    cout<<"Username: ";
  83.    cin>>users;
  84.    cout<<"Password: ";
  85.    cin>>password;
  86.    if(users == users1 | users == users2)
  87.    {
  88.       z=z+1;
  89.    }
  90.    if(password == pass1 | password == pass2)
  91.    {
  92.       z=z+1;
  93.    }
  94.    if(z==2)
  95.    {
  96.       cout<<""<<endl;
  97.       string user = users;
  98.       system("color 07");
  99.       cout<<"Logged in as: "<<user<<endl;
  100.    }
  101. //  if(z!=2)
  102. //  {
  103. //    cout>>"sorry";
  104. //  }
  105. */
  106.  
  107.  
  108.    cout << "Username: ";
  109.    cin >> user;
  110.    cout << "Password: ";
  111.    cin >> password;
  112.  
  113.    Authentication auth;
  114.  
  115.    if( !auth.userExists(user) )
  116.    {
  117.       cout << "User not found\n";
  118.    }
  119.    else // user does exist
  120.    {
  121.       if( !auth.checkAccess(user, password) )
  122.       {
  123.          cout << "Wrong password\n";
  124.       }
  125.       else
  126.       {
  127.          cout << "Access granted\n";
  128.          z=2;
  129.       }
  130.  
  131.          cout<<""<<endl;
  132.    cout << "E-SHELL v.2.0> ";
  133.    getline(cin, input); // read the remaining newline
  134.    string user;
  135.    string password;
  136.  
  137.    while(z==2)
  138.    {
  139.  
  140.       getline(cin, input);
  141.       int pos = input.find(" ");
  142.       command = input.substr(0, pos);
  143.       if(command == "" )
  144.       {
  145.          // noop
  146.       }
  147.       else if(command == "cat")
  148.       {
  149.          argument = input.substr(pos+1);
  150.          infile.open(argument.c_str());
  151.  
  152.          if (!infile.is_open())
  153.          {
  154.             cerr <<"Could not open file.\n";
  155.             exit(-1);
  156.          }
  157.          //do cat code heren (just a while loop with getline)
  158.          while(getline(infile, cat))
  159.          {
  160.             cout<<""<<endl;
  161.             cout << cat << endl;
  162.          }
  163.       }
  164.       else if(command == "exit")
  165.       {
  166.          exit(0);
  167.       }
  168.       else if(command == "ls")
  169.       {
  170.          cout<<""<<endl;
  171.          cout<<"Add all to see hidden files"<<endl;
  172.          cout<<""<<endl;
  173.          system("dir");
  174.       }
  175.       else if(command == "lsall")
  176.       {
  177.          cout<<""<<endl;
  178.          system("dir/a");
  179.       }
  180.       else if(command == "ip")
  181.       {
  182.          system("ipconfig");
  183.       }
  184.       else if(command == "ipfix")
  185.       {
  186.  
  187.          system("start ipfix.bat");
  188.       }
  189.       else if(command == "clear")
  190.       {
  191.          system("cls");
  192.       }
  193.       else if(command =="rm")
  194.       {
  195.          command = input.substr(0, pos);
  196.          argument = input.substr(pos+1);
  197.          if( remove( argument.c_str() )!= 0 )
  198.          {
  199.             cerr << "Error deleting file, argument:" << argument;
  200.          }
  201.          else
  202.          {
  203.             cout<< "File successfully deleted" ;
  204.          }
  205.       }
  206.       else if(command == "rname")
  207.       {
  208.          command = input.substr(0, pos);
  209.          int pos2= input.find(" ", pos+1);
  210.          string oldname = input.substr(pos+1, pos2-pos);
  211.          string newname = input.substr(pos2+1);
  212.          //their code
  213.          int result;
  214.          result= rename( oldname.c_str() , newname.c_str () );
  215.          if ( result == 0 )
  216.             cout<< "File successfully renamed"<<endl;
  217.          else
  218.             cerr << "Error renaming file, argument:" << argument;
  219.       }
  220.       else if(command == "echo")
  221.       {
  222.          int pos2= input.find(">");
  223.          ofstream outfile;
  224.          argument = input.substr(pos+1);
  225.          outfile.open(input.substr(pos2+1).c_str());
  226.          outfile << input.substr(pos+1, pos2-(pos+1));
  227.          outfile.close();
  228.       }
  229.       else if (command =="cd")
  230.       {
  231.          // DirectoryInfo di = new DirectoryInfo("test");
  232.          // di.Attributes |= FileAttributes.ReadOnly;
  233.          //if(pos == string::npos)
  234.          //{
  235.          system("cd");
  236.          //}
  237.          //else
  238.          //{
  239.          // argument = input.substr(pos);
  240.          // cout << "command running: " << command+argument << endl;
  241.          // system((command + argument).c_str());
  242.          //}
  243.       }
  244.       else if (command == "move")
  245.       {
  246.  
  247.          int pos2= input.find(" ", pos+1);
  248.          argument = input.substr(pos+1);
  249.          //system("move");
  250.          system ((command +" "+ argument).c_str());
  251.       }
  252.       else if (command == "mkdir")
  253.       {
  254.          int pos2= input.find(" ", pos+1);
  255.          argument = input.substr(pos+1);
  256.          //system("mkdir")
  257.          system ((command +" "+ argument).c_str());
  258.       }
  259.       else if (command == "rmdir")
  260.       {
  261.          int pos2= input.find(" ", pos+1);
  262.          argument = input.substr(pos+1);
  263.          //system("rmdir")
  264.          system ((command +" "+ argument).c_str());
  265.       }
  266.       else if(command == "shutl")
  267.       {
  268.          cout<<""<<endl;
  269.          cout <<"Different Ways to shutdown."<<endl;
  270.          cout<<""<<endl;
  271.          cout<<"shutf immediatlly shutdowns the computer"<<endl;
  272.       }
  273.       else if(command == "shutf")
  274.       {
  275.          system("shutdown /f");
  276.       }
  277.       else if(command == "td")
  278.       {
  279.          cout<<""<<endl;
  280.          cout <<"DATE: " << date << endl;
  281.          cout <<"TIME: " << time << endl;
  282.          cout<<""<<endl;
  283.       }
  284.       else if(command == "note")
  285.       {
  286.          system("START /MAX NOTEPAD");
  287.       }
  288.       else if(command == "browse")
  289.       {
  290.          //string b;
  291.          //cout<<" Enter Your Search Here"<<endl;
  292.          //cin>>b;
  293.          //call "C:\Program Files\Internet Explorer\iexplore.exe" "b"
  294.       }
  295.       else if (command == "tips")
  296.       {
  297.          cout<<""<<endl;
  298.          cout<<"1. Hit F7 to see a list of usefull commands"<<endl;
  299.          cout<<"2. Type in shutl to see a list of shutdown commands"<<endl;
  300.          cout<<"3. Type in cac to get to a command line based caculator"<<endl;
  301.       }
  302.       else if (command == "help" | command == "/?" | command == "?" | command == "commands")
  303.       {
  304.          cout <<"" <<endl;
  305.          cout <<"Here is the list of all of the commands that this shell has so far.." <<endl;
  306.          cout <<"" <<endl;
  307.          cout <<" TIPS  Displays a list of usefull commands"<<endl;
  308.          cout <<" SHUTL lists a couple of different ways to shutdown"<<endl;
  309.          cout <<" CAT   Can read files" <<endl;
  310.          cout <<" NOTE  Opens notepad"<<endl;
  311.          cout <<" ECHO  Can write or edit files" <<endl;
  312.          cout <<" RM    Deletes a file permanantly"<<endl;
  313.          cout <<" RNAME Renames a certain file"<<endl;
  314.          cout <<" TD    Displays the time and date"<<endl;
  315.          cout <<" LS    A list of the contents inside directory" <<endl;
  316.          cout <<" LSALL Displays all the files, including hidden, in the current directory"<<endl;
  317.          cout <<" MOVE  Moves a file to a folder"<<endl;
  318.          cout <<" MKDIR Makes a new folder in current Directory"<<endl;
  319.          cout <<" RMDIR Removes a direcotry (/s to remove everthing in direcoty"<<endl;
  320.          cout <<" CD    Displays the address of the current directory" <<endl;
  321.          cout <<" IP    Displays your ip adderess and subnet mask" <<endl;
  322.          cout <<" IPFIX Renews your ip addres which usually fixes the problem" <<endl;
  323.          cout <<" CLEAR Clears the screen" <<endl;
  324.          cout <<" HELP  Displays a list of commands working on v.1.0"<<endl;
  325.          cout <<" EXIT  Exits the shell immediately" <<endl;
  326.       }
  327.  
  328.       else
  329.       {
  330.          system("color 0c");
  331.          cout << "This command is not recognized by this shell."<<endl;
  332.          cout << "Type in help to see a list of commands.";
  333.          cout << "\a";
  334.          cout << "\a";
  335.          cout << "\a"<<endl;
  336.          system("PAUSE");
  337.          system("color 07");
  338.       }
  339.  
  340.       cout<<""<<endl;
  341.       cout << "E-SHELL v.2.0> ";
  342.   }
  343.  
  344.    return 0;
  345. }
  346. }

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > General - C++ login thing HELP


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap