MFC中从剪切板取出数据的函数
{
// TODO: Add your control notification handler code here
if(OpenClipboard())
{
if(IsClipboardFormatAvailable(CF_TEXT))
{
HANDLE hClip;
char *pBuf;
hClip=GetClipboardData(CF_TEXT);
pBuf=(char *)GlobalLock(hClip);
GlobalUnlock(hClip);
}
CloseClipboard();
}
}
MFC 中用于保存文件的CFileDialog类函数
CFileDialog fileDlg(FALSE);
fileDlg.m_ofn.lpstrTitle="保存";
fileDlg.m_ofn.lpstrFilter="Text Files(*.txt)\0*.txt\0ALL Files(*.)\0*.*\0\0";
fileDlg.m_ofn.lpstrDefExt="txt";
if(IDC_BUTTON1==fileDlg.DoModal())
{
CFile file(fileDlg.GetFileName(),CFile::modeCreate | CFile::modeWrite);
file.Write("http:??",strlen("http:??"));
file.Close();
}
C#中用于连接数据库的连接字符串
private static String myConnectionString = "server=Localhost;database=data;UID=wyj;Password=123;Persist security info=True;database=data;";