惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

博客园 - 夜渡寒潭

example windows7 64位下安装apache和php 一个js,记录方便查询。 用了锚的时候,有的层被覆盖了。 日,在ie10下面hover里不能控制table 在实现tab的时候,margin-bottom:-1px无效的问题 javascript中,在一个类里attache的event事件中,如果调用类的成员变量和方法 javascript定义类,并实例化的各类之间成员变量不干扰。 php里www用户建立的文件ftp用户无法删除的情况 用C++实现读取windows日志并用zlib压缩后通过jwsmtp邮件发送出去. 再见,我的念青五笔。 如何在Linux下增加Apache的虚拟主机 如何解决在IE6下不自动换行的问题 重庆旅游网新版上线,欢迎测试! 祭5.12地震死难者文[转] __cdecl __fastcall与 __stdcall的说明(转) Windows 应用 Linux手记 - 夜渡寒潭 - 博客园 在Windows下编译OpenSSL
VC++中控制控件台字体颜色(转) - 夜渡寒潭 - 博客园
夜渡寒潭 · 2006-12-04 · via 博客园 - 夜渡寒潭

#include "windows.h"
#include 
<iostream>
#include 
<string>
#include 
"head.h"

using namespace std;

enum clr{ FB = FOREGROUND_BLUE,
            FG 
= FOREGROUND_GREEN,
            FR 
= FOREGROUND_RED,
            FI 
= FOREGROUND_INTENSITY,
            BB 
= BACKGROUND_BLUE,
            BG 
= BACKGROUND_GREEN,
            BR 
= BACKGROUND_RED,
            BI 
= BACKGROUND_INTENSITY }
;

class color
{
public:
    
explicit color( WORD wAttributes = getcurrentvalue_() ) : wAttributes_(wAttributes)
    
{
    }

    WORD getvalue( 
void ) const
    
{
        
return wAttributes_;
    }

private:
    
static WORD getcurrentvalue_( void )
    
{
        CONSOLE_SCREEN_BUFFER_INFO csbi;
        ::GetConsoleScreenBufferInfo( ::GetStdHandle(STD_OUTPUT_HANDLE), 
&csbi );
        
return csbi.wAttributes;
    }

    WORD wAttributes_;
}
;

const color setcolor( WORD wAttributes )
{
    ::SetConsoleTextAttribute( ::GetStdHandle(STD_OUTPUT_HANDLE), wAttributes );
    
return color(wAttributes);
}


const color setcolor( color clrAttributes )
{
    
return setcolor( clrAttributes.getvalue() );
}


ostream
& operator<<( ostream& os, const color& wc )
{
    
return os;
}
;

istream
& operator>>( istream& os, const color& wc )
{
    
return os;
}
;

class position
{
public:
    position( SHORT row, SHORT col ) : row_(row), col_(col)
    
{
    }


    position( 
const position& pos = getcurrentvalue_() ) : row_(pos.row_), col_(pos.col_)
    
{
    }


    SHORT getrow( 
void ) const
    
{
        
return row_;
    }

    SHORT getcol( 
void ) const
    
{
        
return col_;
    }

private:
    
static const position getcurrentvalue_( void )
    
{
        CONSOLE_SCREEN_BUFFER_INFO csbi;
        ::GetConsoleScreenBufferInfo( ::GetStdHandle(STD_OUTPUT_HANDLE), 
&csbi );
        
return position( csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y );
    }

    SHORT row_, col_;
}
;

const position setpos( SHORT row, SHORT col )
{
    COORD coord 
= { col, row };
    ::SetConsoleCursorPosition( ::GetStdHandle(STD_OUTPUT_HANDLE), coord );
    
return position( row, col );
}


const position setpos( position pos )
{
    
return setpos( pos.getrow(), pos.getcol() );
}


ostream
& operator<<( ostream& os, const position& wc )
{
    
return os;
}
;

istream
& operator>>( istream& os, const position& wc )
{
    
return os;
}
;


int _tmain(int argc, _TCHAR* argv[])
{
    
using namespace std;
    color oldcolor;
    cout 
<< setcolor(FG) << "输入一段文字吧" << endl;
    
//cout << setpos(1,15) << setcolor(FB) << "输入一段文字吧" << endl;

    
string s;
    cin 
>> setpos(5,10>> setcolor(FI) >> s;
    position curpos;
    cout 
<< setcolor(oldcolor) << "*这里是" << curpos.getrow() << "" << curpos.getcol() << "" << endl;

    setcolor( oldcolor );
    
static int a;
    cout
<<a<<endl;
    getchar();
    
    
return 0;
}