Buy & Register
Games

3D Games

Screensavers
3D Museum
3D List
Shape X
3D Chains
Thorns 3D

Services

Development

Contact Us
Support

Bright Bug Extras
About Us

Mailing List
E-mail: 
Subscribe
Unsubscribe
Subscribe to the Bright Bug Software news mailing list. [ Learn more ]

Samples

HomeX Library Samples Ask question
Bright Bug Software accepts Visa and Mastercard

The following are a few simple samples to show how various operations can easily be performed using the X Library.

Samples
Download, modify, encrypt, and store to disk

Read file tree, build file with each exe file's created time, compress, and write to disk

Download, modify, encrypt, and store to disk
XString
sxData; //Declare variable
sxData
.DownloadFile("http://www.brightbug.com/index.html"); //Download index.html from brightbug.com.
sxData
.ReplaceNoCase("BrightBug","guBthgirB"); //Replace BrightBug with the reverse in the string.
sxData
.Encrypt("MyEncryptPasswordKey"); //Encrypt the HTML page with your key.
sxData
.WriteFile("c:\\XLibrarySample\\EncyptedFile.dat"); //Write the encrypted file to disk
sxData
.Decrypt("MyEncryptPasswordKey"); //Decrypt the HTML page with your key.
sxData
.WriteFile("c:\\XLibrarySample\\index.html"); //Write the plain html to disk.

Read file tree, build file with each exe file's created time, compress, and write to disk
XString sxData; //Declare some variables
XString
sxFileName;
XString
sxCreateTime;
XStringArray
sxaFileList;
sxaFileList
.GetFileList("c:\\"); //Get the filenames on the C: drive
unsigned
int uiLen=sxaFileList.GetLength(); //Get number of files
for
(unsigned int ui=0;ui<uiLen;ui++){  //For each file
   
sxFileName=sxaFileList[ui]; //Copy filename
   if(sxFileName.EndsWithNoCase(".exe")==true){ //If the file ends with .exe without regard to case.
      sxCreateTime.GetFileCreateTime(sxFileName,"MMMM D, YYYY - hh:mm:ss tt"); //Get the file time in my format.
      sxData.FormatAppend("%s\r\n\t%s\r\n",(const char*)sxFileName,(const char*)sxCreateTime); //Append the data.
   }
}

sxData
.Compress(); //Compress our list.
sxData
.WriteFile("c:\\XLibrarySample\\ExeListCompressed.dat"); //Write our list to our directory.
sxData
.Decompress(); //Decompress our compressed list.
sxData
.WriteFile("c:\\XLibrarySample\\ExeList.txt"); //Write the plain text list to our directory.





Sitemap | Befuddled3 | Screensavers | Support | Screensavers | Link To Us

Copyright Policy | Privacy Policy

Copyright © 1998-2008 Bright Bug Software. All rights reserved.