Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
SkinFile.cpp
Package: VC++视频传输.rar [view]
Upload User: hxb_1234
Upload Date: 2010-03-30
Package Size: 8328k
Code Size: 1k
Category:
Visual C++ Books
Development Platform:
Visual C++
- /**************************************************************************************
- * *
- * *
- **************************************************************************************/
- #include "SkinFile.h"
- /*
- * 外壳配置文件类
- */
- SkinFile::SkinFile(char *directory) {
- this->configFile = NULL;
- if(directory != NULL) {
- char *filename;
- filename = (char *) new char[strlen(directory) + 12];
- strcpy(filename, directory);
- this->configFile = fopen(strcat(filename, "\config.txt"), "rt");
- free(filename);
- }
- }
- SkinFile::~SkinFile() {
- }
- int SkinFile::getColor(char *section) {
- if(this->configFile) {
- char buffer[256];
- DWORD found = 0;
- int r = 0, g = 0, b = 0;
- fseek(this->configFile, 0, SEEK_SET);
- while(!found) {
- fgets(buffer, 256, this->configFile);
- if(strstr(buffer, "[background]") != NULL) {
- fgets(buffer, 256, this->configFile);
- sscanf(buffer, "%d, %d, %d", &r, &g, &b);
- found = 1;
- }
- }
- return r + 256*g + 65536*b;
- }
- return 0;
- }
- void SkinFile::Close() {
- if(this->configFile) {
- fclose(this->configFile);
- }
- }