User Tag List

+ Trả lời chủ đề
Trang 1/2 12 CuốiCuối
Hiện kết quả từ 1 tới 10 của 11

Chủ đề: Xin VB book

  1. #1
    Uni
    Guest

    Mặc định

    Ai có làm ơn cho Uni xin với, chất lượng vào nhe.

    Cảm ơn trước. ^_^

  2. #2
    sourire
    Guest

    Mặc định

    Vào trang này nè, bạn sẽ có 3 tập tự học VB đọc tạm được.

  3. #3
    Uni
    Guest

    Mặc định

    Cảm ơn bạn nhiều
    Bộ help của chính VB chắc cũng ok lắm nhỉ?

  4. #4
    nguyenthanhtungtinbk
    Guest

    Mặc định

    Bạn ra hàng đĩa ở hồ Đắc Di (gần cổng trường Kim Liên) có khá nhiều đĩa hay học bằng video. Hoặc kiếm đĩa Code Guru, cho cả VC++ luôn.

  5. #5
    Uni
    Guest

    Mặc định

    Thanks

  6. #6
    Jupiter9244
    Guest

    Mặc định

    Đúng đấy! 1 số thầy cô khoa CNTT rất củ chuối. Cảnh báo các chú K46,47 khi thi
    làm đúng như ông bà cho chép. Sai 1 chữ là đứt ngay đấy.

  7. #7
    nguyenthanhtungtinbk
    Guest

    Mặc định

    Theo kinh nghiệm của tôi thì học mấy món này phải chịu khó search mã nguồn rồi tự nghiên cứu.

  8. #8
    Net_HaLong
    Guest

    Mặc định

    Em co mot chuong trinh thuc hien bang tubor pascal . ma da thu lam rat nhieu lan roi nhung toan bao loi .
    Vay mong cac su huynh giup em giai quyet voi .
    De bai :
    Viet chuong trinh thuc hien cong viec sau :
    Lap lai
    + hien thi loi moi hoac dau nhac .
    + nhap mot sau ky tu tu ban phim.
    Neu xau do la "xem thu muc" thi hay thuc hien lenh DIR
    Neu xau do la "ngay thang "thi thuc hien lenh DATE
    Neu xau do la "ten tep.EXE or .COM or .BAT thi thuc hien lenh do.

    Vay mong cac huynh giup do em voi.
    Xin chan thanh cam on.
    _________________
    YM::beyeu_hva

  9. #9
    nguyenthanhtungtinbk
    Guest

    Commander

    clsCommander1.h

    Mã:
    #include <iostream> //4 cin and cout
    #include <direct.h> //4 _mkdir, _rmdir and stuff
    #include <string>   //4 the variable string
    #include <conio.h>  //forgot
    #include <io.h>     //4 make a file 
    
    using namespace std;  //import namespace
    
    class CCommander  //The class CCommand
    {
    private:
    	string m_command;
    	string m_curdir;
    public:
    	CCommander() {} ; //Constructor
    	~CCommander() {};  //Destructor
    
    	void GetInput();
    	void CallFunction();
    
                    void Quit();
    	void Help();
    	void About();
    	void ClearScreen();
    	void MakeDirectory();
    	void DeleteDirectory();
    	void RenameDirectory();
    	void MakeFile();
    	void DeleteFile();
    	void RenameFile();	
    	void CurrentDirectory();
    	void ChangeDirectory();
    
    	void FindDir();
    };
    
    
    /****************************
     * What does the user want?
     ****************************/
    void CCommander::GetInput()
    {
    	cout << "command--> ";
    	cin >> m_command;       //Gets input
    	CallFunction();
    }
    void CCommander::CallFunction()
    {
    	if(m_command == "help" || m_command == "HELP")
    	{
    		CCommander::Help();
    	}
    
    	else if(m_command == "exit" || m_command == "EXIT")
    	{
    		CCommander::Quit();
    	}
    
    	else if(m_command == "about" || m_command == "ABOUT")
    	{
    		CCommander::About();
    	}
    
    	else if(m_command == "delfile" || m_command == "DELFILE")
    	{
    		CCommander::DeleteFile();
    	}
    	
    	else if(m_command == "mkdir" || m_command == "MKDIR")
    	{
    		CCommander::MakeDirectory();
    	}
    
    	else if(m_command == "deldir" || m_command == "DELDIR")
    	{
    		CCommander::DeleteDirectory();
    	}
    
    	else if(m_command == "chgdir" || m_command == "CHGDIR")
    	{
    		CCommander::ChangeDirectory();
    	}
    
    	else if(m_command == "curdir" || m_command == "CURDIR")
    	{
    		CCommander::CurrentDirectory();
    	}
    
    	else if(m_command == "cls" || m_command == "CLS")
    	{
    		CCommander::ClearScreen();
    	}
    
    	else if(m_command == "rnmfile" | m_command == "RNMFILE")
    	{
    		CCommander::RenameFile();
    	}
    
    	else if(m_command == "mkfile" || m_command == "MKFILE")
    	{
    		CCommander::MakeFile();
    	}
    
    	else if(m_command == "rnmdir" || m_command == "RNMDIR")
    	{
    		CCommander::RenameDirectory();
    	}
    
    	else if(m_command == "srcdir" || m_command == "SRCDIR")
    	{
    		CCommander::FindDir();
    	}
    
    	else
    	{
    		cout << "Unknown command.Type 'help' to see all commands \n";
    		CCommander::GetInput();
    	}
    }
    
    /*****************
     * Start process
     *****************/
    void CCommander::Help()
    {
    	//Draw text
    	cout << "Commands: \n" << "\n";   
    	cout << "command: cls     | Clear screen \n";
    	cout << "command: exit    | Exit this program \n";
    	cout << "command: help    | Give command information \n";
    	cout << "command: about   | About this progran \n";
    	cout << "command: mkdir   | Make directory \n";
    	cout << "command: deldir  | Delete directory \n";
    	cout << "command: rnmdir  | Rename directory \n";
    	cout << "command: mkfile  | Make a file \n";
    	cout << "command: delfile | Delete a file \n";
    	cout << "command: rnmfile | Rename a file \n";
    	cout << "command: curdir  | Show current directory \n";
    	cout << "command: chgdir  | Change current directory \n";
    	cout << "command: srcdir  | Search 4 a directory \n";
    	CCommander::GetInput();  //go to that function to get input
    }
    void CCommander::About()
    {
    	//Draw some text
    	cout << "|---------------------------------------------------------------------| \n";	
    	cout << "|This program whas made begin October 6th, 2003.                    | \n";
    	cout << "|Coded by Nguyen Thanh Tung                                           | \n";
    	cout << "|http://tung.vn.web1000.com                                           | \n";
    	cout << "|Email: nguyenthanhtungtinbk@yahoo.com                                | \n";
    	cout << "|Thanks to Hylke Donker of Digital Devil                              | \n";
    	cout << "|Digital Devil http://www.digitaldevil.vze.com                        | \n";
    	cout << "|Email: hylkedonker@msn.com                                           | \n";
    	cout << "|Special thanks to: veganza of www.c-plusplus.de                      | \n";
    	cout << "|If u found bugs, have suggestions or something else please mail me   | \n";
    	cout << "|All Rights Reserved                                                  | \n";
    	cout << "|---------------------------------------------------------------------| \n";
    	CCommander::GetInput(); //go 2 that function 2 get input
    }
    void CCommander::MakeDirectory()
    {
    	string make; //string variable calld make
    input:  //Here we can go back with the code goto input;
    	cout << "Type the name of the directory in the path.Typ 'help' for more info. \n";
    	cout << "Path: ";
    	cin >> make; //Get input
    	if(make == "help" || make == "HELP")  //if typt help or HELP
    	{
    		//Draw some text
    		cout << "2 Create the folder 'test' in the windows directory typ: 'C:\\Windows\\test' \n";
    		cout << "That means that the name of the directory u wan't 2 create is already in the path. \n";
    		cout << "Typ 'cur' and then some text will appear and then u only need to typ the name \n";
    		cout << "of the directory and it will b created in your current directory \n";
    		goto input; //Goto input
    	}
    	else if(make == "cur" || make == "CUR") //if typt cur or CUR
    	{
    		string input; //string variable calld input
    		string newmake; //another string variable
    		cout << "Typ the name of the directory u wan't to create: \n"; //Draw some text
    		cin >> input; //Get input
    		newmake = m_curdir + input; //save the path of currentdirector + input in variable
    		_mkdir(newmake.c_str()); //Make directory
    	}
    	else
    	{
    		_mkdir(make.c_str()); //Make directory
    		
    	}
    		CCommander::GetInput(); //Goto that function 2 get input
    }
    Lần sửa cuối bởi nguyenthanhtungtinbk; 30-11-2003 lúc 10:00 AM

  10. #10
    nguyenthanhtungtinbk
    Guest

    Mặc định

    (Không post được bài quá dài nên tách 2 phần)

    clsCommander1.h (continue ... )

    Mã:
    void CCommander::DeleteDirectory()
    {
    	string del; //Make string variable
    input: //Here we can go back
    	cout << "Typ the name of the directory in the path.Typ help for more info. \n";
    	cout << "Path: "; //draw text
    	cin >> del; //Get input
    	if(del == "help" || del == "HELP") //if typt help or HELP
    	{
    		//Draw some text
    		cout << "2 delete the folder 'test' in the windows directory typ: 'C:\\Windows\\test' \n";
    		cout << "That means that the name of the directory u wan't 2 delete is already in the path. \n";
    		cout << "Or u can type 'cur'.Then some text will apear and u can typ the directory \n";
    		cout << "u wan't 2 delete.Then it will b deleted from your current directory \n";
    		goto input; //Goto input
    	}
    	else if(del == "cur" || del == "CUR") //if typt cur or CUR
    	{
    		string name; //make variable
    		string calculatedname; //Make anothger variable
    		cout << "Typ the name of the directory \n";
    		cin >> name; //Get input
    		calculatedname = m_curdir + name; //calculate path
    		_rmdir(calculatedname.c_str()); //Remove directory
    	}
    
    	else
    	{
    		_rmdir(del.c_str()); //remove directory
    	}
    		CCommander::GetInput(); //go 2 function
    }
    
    void CCommander::RenameDirectory()
    {
    	string oldpath;  //Make so variables
    	string newpath;
    input: //Here we can go back
    	cout << "Typ the path of the directory u wan't to rename(or typ 'help' 4 more info): \n";
    	cin >> oldpath; //Get input
    	if(oldpath == "help" || oldpath == "HELP") //If typt help or HELP
    	{
    		//Draw some text
    		cout << "2 change a directory simpely type first the name.And then it asks 4";
    		cout << " the new name and then it will change.4 this way u need to give the hall ";
    		cout << "path.But when u typ 'cur'.U don't have the typ the hall path.Just the name ";
    		cout << "of the directory and the name u wan't 2 change in it.2 do that the directory ";
    		cout << "has 2 b in the current directory \n";
    		goto input; //Go 2 input in this function
    	}
    	else if(oldpath == "cur" || oldpath == "CUR") //if typt cur ir CUR
    	{
    		//Create variables
    		string oldname;
    		string newname;
    		string calculated_path_old;
    		string calculated_path_new;
    		//Draw text
    		cout << "Type the name of the directory u wan't 2 rename: \n";
    		cin >> oldname; //Get input
    		cout << "Type the new-name of the directory: \n"; //Draw text
    		cin >> newname; //Get input
    		calculated_path_old = m_curdir + oldname; //Calculte the old path
    		calculated_path_new = m_curdir + newname; //Cacukate the new path
    		rename(calculated_path_old.c_str(), calculated_path_new.c_str()); //rename directory
    	}
    	else
    	{
    	cout << "Typ the path of the directory with new name in the path \n"; //Draw text
    	cin >> newpath; //Get input
    	rename(oldpath.c_str(), newpath.c_str()); //Rename directory
    	}
    	CCommander::GetInput(); //Go to that function
    
    }
    
    void CCommander::MakeFile()
    {
    	string path; //Create variable
    input: //Here we can go back
    	cout << "Type path  + extension to create a file \n"; //Draw text
    	cin >> path; //Get input
    	int fh; //Make integer variable
    	if(path == "help" || path == "HELP") //if typt help or HELP
    	{
    		//Draw text
    		cout << "2 make a file just type path + file + extension.Sample: u wan't 2 create a";
    		cout << " text file in the drive C and wanna call it test.Just type: 'C:\\test.txt' ";
    		cout << "But if u wanna make a file in the current directory then type 'cur'.Some text ";
    		cout << "will apear and then typ file + extension \n";
    		goto input; //go 2 input
    	}
    	else if(path == "cur" || path == "CUR") //If typt cur or CUR
    	{
    		//Make variables
    		string calculated_path; 
    		string newpath;
    		cout << "Type file + extension \n"; //Draw text
    		cin >> newpath;  //Get input
    		calculated_path = m_curdir + newpath; //calculate path
    		fh = _creat( calculated_path.c_str(), NULL); //Create file
    	   }
    
       else
       {
    	   fh = _creat( path.c_str(), NULL); //Create file
       }
       CCommander::GetInput(); //go to function CCommander::GetInput
    }
    
    void CCommander::DeleteFile()
    {
    	string path; //Make variable
    input: //Here we can go back
    	cout << "Typ the path + extension(.txt or any other) of the file(or type 'help' 4 more info). \n";
    	cout << "Path: "; //Draw text
    	cin >> path;  //Get input
    	if(path == "help" || path == "HELP") //If typt help or HELP
    	{
    		//Draw text
    		cout << "Type the path + file + extension.Sample: U have a text file in C calld test \n";
    		cout << "Then u need 2 type C:\\hello.txt.But u also can delete it in your current";
    		cout << "directory then u need 2 typ 'cur'.Then some text will apear and then u only ";
    		cout << "Have 2 type file + extension \n";
    		goto input; //Go 2 input
    	}
    	else if(path == "cur" || path == "CUR") //If typt cur or CUR
    	{
    		string calculated_path; //Make variables
    		string newpath;
    		cout << "Type file + extension \n"; //draw text
    		cin >> newpath; //Get input
    		calculated_path = m_curdir + newpath; //Calculate path
    		remove(calculated_path.c_str()); //Remove file
    	}
    	else
    	{
    	remove(path.c_str()); //remoce file
    	}
    	CCommander::GetInput();
    }
    
    void CCommander::RenameFile()
    {
    	//Make variables
    	string oldpath;
    	string newpath;
    	cout << "Typ help for more information \n"; //Draw text
    getinput: //here we can go back
    	cout << "Typ the path of the file u wan't 2 rename + extension: \n"; //Draw text
    	cin >> oldpath; //Get input
    	if(oldpath == "help" || oldpath == "HELP") //if typt help or HELP
    	{
    		//Draw some text
    		cout << "If u wan't 2 rename the file 'hello.txt' in the harddisk c to 'test.txt': \n";
    			cout << "Then typ: 'C:\\hello.txt' \n";
    			cout << "And then typ: 'C:\\test.txt' \n";
    				cout << "Now the file is changed from hello.txt 2 test.txt \n";
    			goto getinput; //Goto getinput in this function
    	}
    	else if(oldpath == "cur" || oldpath == "CUR") //If typt cur or CUR
    	{
    		//Make variables
    		string oldpath;
    		string newpath;
    		string calculated_old_path;
    		string calculated_new_path;
    		cout << "Type the oldname + extension of the file: \n"; //Draw text
    		cin >> oldpath; //Get input
    		cout << "Type the newname + extension of the file: \n";
    		cin >> newpath;
    		calculated_old_path = m_curdir + oldpath; //Calculate the old path
    		calculated_new_path = m_curdir + newpath; //Caculate the new path
    		rename(calculated_old_path.c_str(), calculated_new_path.c_str()); //rename file
    	}
    	else
    	{
    	cout << "Type the path + extension of the file u wan't 2 rename \n"; //draw text
    	cin >> newpath; //Get input
    	rename(oldpath.c_str(), newpath.c_str()); //rename file
    	}
    	CCommander::GetInput(); //go 2 that function
    }
    
    void CCommander::CurrentDirectory()
    {
    	int ch, curdrive; //make variables
       static char path[_MAX_PATH]; //make static character variable
    
       
        cout << "Typ the letter of the drive 2 show current directory: \n"; //Draw text
          ch = _getch(); //Save input in variable ch
          //Draw Current directory
    	  if( isalpha( ch ) )
             _putch( ch );
          if( _getdcwd( toupper( ch ) - 'A' + 1, path, _MAX_PATH ) != NULL )
             cout << "\nCurrent directory on that drive is \n" << path; //Draw text
    
       /* Restore original drive.*/
       _chdrive( curdrive );
       cout << "\n";
       CCommander::GetInput(); //go 2 that function
    
    }
    
    void CCommander::ChangeDirectory()
    {
     	string path; //Make variable
    input: //Here we can go back
    	//Draw some text
      	cout << "Typ the path of the directory u wanna go in(or 'help' 4 more info). \n";
      	cout << "Path: ";
      	cin >> path; //Get input
    	if(path == "help" || path == "HELP") //If typt help or HELP
    	{
    		cout << "Typ the path so that will b your current directory \n"; //Draw text
    		goto input; //goto input
    	}
    	else
    	{
    	chdir(path.c_str()); //Change directory
    	m_curdir = path; //curdir = current directory
    	}
    	CCommander::GetInput(); //Go 2 that function
    }
    
    void CCommander::ClearScreen()
    {
    	system("cls");
    	CCommander::GetInput(); //go 2 that function
    	
    }
    
    void CCommander::Quit()
    {
    
    	cout << "Press any key to quit"; //Draw text
    	_getch(); //Wait till key pressed
    	
    }
    
    void CCommander::FindDir()
    {
    	system("dir");
        CCommander::GetInput(); //Go 2 that function
    }

    Main.cpp
    Mã:
    #include "clsCommander1.h"
    
    void main()
    {
    	CCommander Commander;
    	Commander.About();
    	Commander.GetInput();
    }

+ Trả lời chủ đề
Trang 1/2 12 CuốiCuối

Thông tin chủ đề

Users Browsing this Thread

Hiện có 1 người đọc bài này. (0 thành viên và 1 khách)

Chủ đề tương tự

  1. E-Book cho Sinh Viên Viện Khoa Học và Công Nghệ Nhiệt-Lạnh
    Gửi bởi longhunter trong mục VIỆN KH&CN NHIỆT LẠNH
    Trả lời: 23
    Bài cuối: 11-08-2013, 09:47 AM
  2. Làm thế nao` để up book lên BKLIB ?
    Gửi bởi DLivetoL.bk trong mục Hỏi đáp và góp ý xây dựng svBK
    Trả lời: 3
    Bài cuối: 24-06-2006, 09:55 PM
  3. E-book về DotnetNuke
    Gửi bởi frankie trong mục Lập Trình
    Trả lời: 1
    Bài cuối: 13-02-2006, 08:30 AM
  4. English learning New interchange 3 students book videocourse
    Gửi bởi Mr.vulh_bk trong mục Địa chỉ, tài liệu, phần mềm hữu ích
    Trả lời: 4
    Bài cuối: 20-12-2005, 12:15 PM
  5. Book and mp3 for practice IELTS
    Gửi bởi Mr.vulh_bk trong mục Địa chỉ, tài liệu, phần mềm hữu ích
    Trả lời: 3
    Bài cuối: 01-10-2005, 11:44 AM

Từ khóa (Tag) của chủ đề này

Quyền viết bài

  • Bạn không thể gửi chủ đề mới
  • Bạn không thể gửi trả lời
  • Bạn không thể gửi file đính kèm
  • Bạn không thể sửa bài viết của mình


About svBK.VN

    Bách Khoa Forum - Diễn đàn thảo luận chung của sinh viên ĐH Bách Khoa Hà Nội. Nơi giao lưu giữa sinh viên - cựu sinh viên - giảng viên của trường.

Follow us on

Twitter Facebook youtube