This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Calculator Programming subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. General Coding and Design => Calculator Programming
Author Message
JoeImp
Enlightened


Active Member


Joined: 24 May 2003
Posts: 747

Posted: 13 Oct 2003 10:35:02 am    Post subject:

Lol, I was talking to someone yesterday, and they wanted me to make up some source for them. Sorry I forgot who you were, lol I was really tired Razz Well, here you go:



Code:
#include <iostream.h>
#include <stdio.h>
#include <windows.h>

/* These Are All Folder Functions. I Don't Remeber Exactly
   What You Asked, So If You Want File Functions, Just
   Ask, And Ill Get Those Down. I Included A Sample
   Program At The Bottom That Finds All The Drives
   On A Computer, If It Would Ever Come In Handy
   :p Peace */

void main()
{

   // GetCurrentDirectory Retrives The Directory You Have Open (Obviously)
   // DirBuffer Is The Buffer To The Function

   char DirBuffer[100];

   //GetCurrentDirectory(SizeOfBuffer, Buffer Pointer)

   if (GetCurrentDirectory(100, DirBuffer) == 0)
   {
  // Error Message

  cout << "\n\nNo Current Directory";
   }
   else
   {
  // Display The Results If It Worked

  cout << "\nCurrent Dir: " << DirBuffer;
   }

   // SetCurrentDirectory Sets What Directory You Supposedly Have Open
   // SetCurrentDirectory(Directory)

   if (SetCurrentDirectory("C:/") == FALSE)
   {
  // Error Message If Directory Doesnt Exist

  cout << "\n\nC:/ does not exist";
   }

   // Create Directory Makes A Directory (Obviously)
   // CreateDirectory(Directory)

   if (CreateDirectory("C:/NEWFOLDER",NULL) == FALSE)
   {
  // Error Message

  cout << "\n\nError In Creating C:/NEWFOLDER";
   }

   // MoveFile Moves A File Or Directory To Another NONEXISTING Directory
   // MoveFile(Start Directory, End Directory)

   if (MoveFile("C:/NEWFOLDER", "C:/NEWFOLDER2") == FALSE)
   {
  // Error Message

  cout << "\n\nError In Moving C:/NEWFOLDER to C:/NEWFOLDER2";
   }

   // Remove Directory Removes A Directory (Obviously)
   // RemoveDirectory(Directory)

   if (RemoveDirectory("C:/NEWFOLDER2") == FALSE)
   {
  // Error Message

  cout << "\n\nError In Removing C:/NEWFOLDER2";
   }

}

// ||||||||||||||||||||||||||||||||||||||
// ||             ICE PEEK v1.0          |
// ||||||||||||||||||||||||||||||||||||||


/*

  #include <windows.h>
#include <iostream.h>
#include <stdio.h>

char DriveList[] = "ABCDEFGHIJKLMNPQRSTUVWXYZ";
char FullDrive[] = " :\\";
char blah[10];
char VolName[128];
char FileSystem[128];
unsigned long VolSerNum, MaxComLength, SystemFlags;
unsigned int result;
void DisplayInfo();

void main()
{
   cout << "IcePeek v1.0 - Made By Joe Impellizzieri"
     << "\nGroups: UnitedTI, HDC, Prokul Interactive"
     << "\nContact At: Iceman2oo0@hotmail.com"
     << "\nCoder Not At Fault For Illegal Usage"
     << "\n\nUsed For Finding All The Drives On The System\n\n";
   cout.flush();
   system("pause");
   for (int i = 0; i < 25; i++)
   {
  FullDrive[0] = DriveList[i];
  result = GetDriveType(FullDrive);
  switch (result)
  {
     case 5:
    cout << "\n\nDrive " << FullDrive << " - CD-ROM Drive";
    DisplayInfo();
     break;
     case 3:
    cout << "\n\nDrive " << FullDrive << " - Hard Drive";
    DisplayInfo();
     break;
     case 6:
    cout << "\n\nDrive " << FullDrive << " - Ram Disk";
    DisplayInfo();
     break;
     case 4:
    cout << "\n\nDrive " << FullDrive << " - Network Drive";
    DisplayInfo();
     break;
     case 2:
    cout << "\n\nDrive " << FullDrive << " - Removable Drive";
    DisplayInfo();
     break;
  }
   }
   cout << "\n\n<<<All Drives Scanned>>>\n\n";
   cout.flush();
   cin >> blah;
}
void DisplayInfo()
{
   GetVolumeInformation(FullDrive, VolName, 128, &VolSerNum, &MaxComLength, &SystemFlags, FileSystem, 128);
   cout << "\n|Volume Name|: " << VolName << "  |Volume Serial Number|: " << VolSerNum;
   cout << "\n|Max Components Length|: " << MaxComLength << "  |System Flags|: " << SystemFlags;
   cout << "\nFileSystem: " << FileSystem;
}


 */


Last edited by Guest on 13 Oct 2003 10:36:33 am; edited 1 time in total
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement