啤酒

一个空白者

 

随笔!

////////////////////////////////////////////////////////////////////////////////////////// 
这样可以选中呀
int nItem = -1;
 nItem = m_listApp.GetNextItem(nItem, LVNI_SELECTED);
 m_listApp.DeleteItem(nItem);
////////////////////////////////////////////////////////////////////////////////////////////
1。弹出方式菜单
// The code fragment shows how to get the File menu from the
// application window and displays it as a floating popup menu
// when the right mouse button is clicked in view.
// CMyView is a CView-derived class.
void CMyView::OnRButtonDown(UINT nFlags, CPoint point) 
{
  CView::OnRButtonDown(nFlags, point);

  CMenu* menu_bar = AfxGetMainWnd()->GetMenu();
  CMenu* file_menu = menu_bar->GetSubMenu(0); 
  ASSERT(file_menu);

  file_menu->TrackPopupMenu(TPM_LEFTALIGN |TPM_RIGHTBUTTON, point.x, 
    point.y, this);
}
2。图标设置
BOOL CListCtrlDemoDlg::InitImageList()
{
 // Create 256 color image lists
 HIMAGELIST hList = ImageList_Create(32,32, ILC_COLOR8 |ILC_MASK , 8, 1);
 m_cImageListNormal.Attach(hList);
 hList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 8, 1);
 m_cImageListSmall.Attach(hList);

 


 // Load the large icons
 CBitmap cBmp;

 

 cBmp.LoadBitmap(IDB_IMAGES_NORMAL);
 m_cImageListNormal.Add(&cBmp, RGB(255,0, 255));
 cBmp.DeleteObject();

 

 // Load the small icons
 cBmp.LoadBitmap(IDB_IMAGES_SMALL);
 m_cImageListSmall.Add(&cBmp, RGB(255,0, 255));

 

 // Attach them
 m_cListCtrl.SetImageList(&m_cImageListNormal, LVSIL_NORMAL);
 m_cListCtrl.SetImageList(&m_cImageListSmall, LVSIL_SMALL);

 

 return TRUE;

}
3。插入图标
/////////////////////////////////////////////////////////////////////////////
void CListCtrlDemoDlg::InsertItems()
{
 //删除所有的当前条目内容
 m_cListCtrl.DeleteAllItems();

 

 //用LV_ITEM结构指向要插入的条目
 LVITEM lvi;
 CString strItem;
 for (int i = 0; i < m_nItems; i++)
 {
  // Insert the first item
  lvi.mask =  LVIF_IMAGE | LVIF_TEXT;
  strItem.Format(_T("Item %d"), i);
 
  lvi.iItem = i;

 

  lvi.iSubItem = 0;
  lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
  lvi.iImage = i%8;  // There are 8 images in the image list
  m_cListCtrl.InsertItem(&lvi);

 

  // Set subitem 1
  strItem.Format(_T("%d"), 10*i);
  lvi.iSubItem =1;
  lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
  m_cListCtrl.SetItem(&lvi);

 

  // Set subitem 2
  strItem.Format(_T("%s"), COleDateTime::GetCurrentTime().Format(_T("Created: %I:%M:%S %p, %m/%d/%Y")));
  lvi.iSubItem =4;
  lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
  m_cListCtrl.SetItem(&lvi);

 

 }
}
4。删除条目
void CMmDlg::OnDelete()
{
 int i,iState;

 int nItemSelected=m_mm_host_ListCtrl.GetSelectedCount();//得到所选表项数

 int nItemCount=m_mm_host_ListCtrl.GetItemCount();//得到表项总数

 if(nItemSelected<1)//如果没有选中行,退出
  return;

 for(i=nItemCount-1;i>=0;i--)
 {

  iState=m_mm_host_ListCtrl.GetItemState(i,LVIS_SELECTED);

  if(iState!=0)
   m_mm_host_ListCtrl.DeleteItem(i);
 }
}
5。击活条目

void CMmDlg::OnClickList(NMHDR* pNMHDR, LRESULT* pResult)
{
 // TODO: Add your control notification handler code here
 int nItem = -1;
 
 LPNMITEMACTIVATE lpNMItemActivate = (LPNMITEMACTIVATE)pNMHDR;

 if(lpNMItemActivate != NULL)
 {
  nItem = lpNMItemActivate->iItem;
 }

 //CString str;
 //str.Format("%d",nItem);
 //MessageBox(str);

 *pResult = 0;
}

posted @ 2006-08-30 14:48 啤酒 阅读(361) | 评论 (1)编辑 收藏

CListCtrl使用技巧

//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
排序算发
// SortTextItems	- Sort the list based on column text// Returns		- Returns truefor success// nCol			- column that contains the text to be sorted// bAscending		- indicate sort order// low			- row to start scanning from - default row is 0// high			- row to end scan. -1 indicates last row
字符串
/////////////////////////// BOOL CMyListCtrl::SortTextItems( int nCol, BOOL bAscending,  int low /*= 0*, int high /*= -1* ) { if( nCol >= ((CHeaderCtrl*)GetDlgItem(0))->GetItemCount() ) return FALSE; if( high == -1 ) high = GetItemCount() - 1; int lo = low; int hi = high; CString midItem; if( hi <= lo ) return FALSE; midItem = GetItemText( (lo+hi)/2, nCol ); // loop through the list until indices crosswhile( lo <= hi ) { // rowText will hold all column text for one row CStringArray rowText; // find the first element that is greater than or equal to // the partition element starting from the left Index.if( bAscending ) while( ( lo < high ) && ( GetItemText(lo, nCol) < midItem ) ) ++lo; elsewhile( ( lo < high ) && ( GetItemText(lo, nCol) > midItem ) ) ++lo; // find an element that is smaller than or equal to // the partition element starting from the right Index.if( bAscending ) while( ( hi > low ) && ( GetItemText(hi, nCol) > midItem ) ) --hi; elsewhile( ( hi > low ) && ( GetItemText(hi, nCol) < midItem ) ) --hi; // if the indexes have not crossed, swap// and if the items are not equalif( lo <= hi ) { // swap only if the items are not equalif( GetItemText(lo, nCol) != GetItemText(hi, nCol)) { // swap the rows LV_ITEM lvitemlo, lvitemhi; int nColCount =  ((CHeaderCtrl*)GetDlgItem(0))->GetItemCount(); rowText.SetSize( nColCount ); int i; for( i=0; i<nColCount; i++) rowText[i] = GetItemText(lo, i); lvitemlo.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; lvitemlo.iItem = lo; lvitemlo.iSubItem = 0; lvitemlo.stateMask = LVIS_CUT | LVIS_DROPHILITED |  LVIS_FOCUSED |  LVIS_SELECTED |  LVIS_OVERLAYMASK | LVIS_STATEIMAGEMASK; lvitemhi = lvitemlo; lvitemhi.iItem = hi; GetItem( &lvitemlo ); GetItem( &lvitemhi ); for( i=0; i<nColCount; i++) SetItemText(lo, i, GetItemText(hi, i)); lvitemhi.iItem = lo; SetItem( &lvitemhi ); for( i=0; i<nColCount; i++) SetItemText(hi, i, rowText[i]); lvitemlo.iItem = hi; SetItem( &lvitemlo ); } ++lo; --hi; } } // If the right index has not reached the left side of array// must now sort the left partition.if( low < hi ) SortTextItems( nCol, bAscending , low, hi); // If the left index has not reached the right side of array// must now sort the right partition.if( lo < high ) SortTextItems( nCol, bAscending , lo, high ); return TRUE; }

//////////////////////////////////////////////////////////

数值:
bool CMyListCtrl::SortNumericItems( int nCol, BOOL bAscending,int low/*=0*, int high/*=-1* )
{
	if( nCol >= ((CHeaderCtrl*)GetDlgItem(0))->GetItemCount() )
		return FALSE;

	if( high == -1 ) high = GetItemCount() - 1;

	int lo = low;
	int hi = high;
	CString midItem;

	if( hi <= lo )
	      return FALSE;

	midItem = GetItemText( (lo+hi)/2, nCol );

	// loop through the list until indices crosswhile( lo <= hi )
	{
 		// rowText will hold all column text for one row
 		CStringArray rowText;

 		// find the first element that is greater than or equal to// the partition element starting from the left Index.if( bAscending )
  			//while( ( lo < high ) && (atoi(GetItemText(lo, nCol)) < midItem ) )
			/*!!!*  while( ( lo < high ) && ( CmpItems( GetItemText(lo, nCol) , midItem, nCol) < 0 ) )
   				++lo;
 		else//while( ( lo < high ) && (atoi(GetItemText(lo, nCol)) > midItem ) )
			/*!!!*  while( ( lo < high ) && ( CmpItems( GetItemText(lo, nCol) , midItem, nCol) > 0 ) )
   			++lo;

 		// find an element that is smaller than or equal to// the partition element starting from the right Index.if( bAscending )
  			//while( ( hi > low ) && (atoi(GetItemText(hi, nCol)) > midItem ) )
			/*!!!*  while( ( hi > low ) && ( CmpItems(GetItemText(hi, nCol) , midItem, nCol ) > 0 ) )
   				--hi;
 		else//while( ( hi > low ) && (atoi(GetItemText(hi, nCol)) < midItem ) )
			/*!!!*  while( ( hi > low ) && ( CmpItems(GetItemText(hi, nCol) , midItem, nCol ) < 0 ) )
   			--hi;

 		// if the indexes have not crossed, swap// and if the items are not equalif( lo <= hi )
 		{
			// swap only if the items are not equal//if(atoi(GetItemText(lo, nCol)) != atoi(GetItemText(hi, nCol)) )
			/*!!!*  if( CmpItems (GetItemText(lo, nCol) , GetItemText(hi, nCol), Col  ) != 0) {
	   			// swap the rows
	   			LV_ITEM lvitemlo, lvitemhi;

	   			int nColCount = ((CHeaderCtrl*)GetDlgItem(0))->GetItemCount();
	   			rowText.SetSize( nColCount );

	   			int i;
	   			for( i=0; i < nColCount; i++)
	      			rowText[i] = GetItemText(lo, i);

	   			lvitemlo.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_STATE;
	   			lvitemlo.iItem = lo;
	   			lvitemlo.iSubItem = 0;
	   			lvitemlo.stateMask = LVIS_CUT | LVIS_DROPHILITED |
	      					LVIS_FOCUSED |  LVIS_SELECTED |
	      					LVIS_OVERLAYMASK | LVIS_STATEIMAGEMASK;
	   			lvitemhi = lvitemlo;
	   			lvitemhi.iItem = hi;

	   			GetItem( &lvitemlo );
	   			GetItem( &lvitemhi );

	   			for( i=0; i< nColCount; i++)
	      			SetItemText(lo, i, GetItemText(hi, i) );

	   			lvitemhi.iItem = lo;
	   			SetItem( &lvitemhi );

	   			for( i=0; i< nColCount; i++)
	      			SetItemText(hi, i, rowText[i]);

	   			lvitemlo.iItem = hi;
	   			SetItem( &lvitemlo );
	  		}

	  		++lo;
	  		--hi;
	 	}
	}

	// If the right index has not reached the left side of array// must now sort the left partition.if( low < hi )
 		SortNumericItems( nCol, bAscending , low, hi);

	// If the left index has not reached the right side of array// must now sort the right partition.if( lo < high )
 		SortNumericItems( nCol, bAscending , lo, high );

	return TRUE;
}








//////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////// int i = 0;
CString str;
str.Format("%d",i*10);
// 序号for(i=0;i<10;i++)
 {    
      str.Format("%d",i*10);
   m_mm_host_ListCtrl.InsertItem(i, str, 0);
      m_mm_host_ListCtrl.SetItemText(i, 1, str);      m_mm_host_ListCtrl.SetItemText(i, 2, str);      m_mm_host_ListCtrl.SetItemText(i, 3, str);}
/////////////////////////////////

void CMmDlg::OnDelete()
{
 int i,iState;

 int nItemSelected=m_mm_host_ListCtrl.GetSelectedCount();//所选表项数 
 int nItemCount=m_mm_host_ListCtrl.GetItemCount();//表项总数 
 if(nItemSelected<1)
  return;
 for(i=nItemCount-1;i>=0;i--)
 {
  iState=m_mm_host_ListCtrl.GetItemState(i,LVIS_SELECTED); 
  if(iState!=0) 
   m_mm_host_ListCtrl.DeleteItem(i);
 }
}
////////////////////////////////////////////////////////////////
CListCtrl使用技巧[转]








/////////////////////////////////////////////////////////////////
 

1. CListCtrl 风格

      LVS_ICON: 为每个item显示大图标
      LVS_SMALLICON: 为每个item显示小图标
      LVS_LIST: 显示一列带有小图标的item
      LVS_REPORT: 显示item详细资料
      直观的理解:windows资源管理器,“查看”标签下的“大图标,小图标,列表,详细资料”
				
 

2. 设置listctrl 风格及扩展风格

      LONG lStyle;
      lStyle = GetWindowLong(m_list.m_hWnd, GWL_STYLE);//获取当前窗口style
      lStyle &= ~LVS_TYPEMASK; //清除显示方式位
      lStyle |= LVS_REPORT; //设置style
      SetWindowLong(m_list.m_hWnd, GWL_STYLE, lStyle);//设置style
 
      DWORD dwStyle = m_list.GetExtendedStyle();
      dwStyle |= LVS_EX_FULLROWSELECT;//选中某行使整行高亮(只适用与report风格的listctrl)
      dwStyle |= LVS_EX_GRIDLINES;//网格线(只适用与report风格的listctrl)
      dwStyle |= LVS_EX_CHECKBOXES;//item前生成checkbox控件
      m_list.SetExtendedStyle(dwStyle); //设置扩展风格
 
      注:listview的style请查阅msdn
      http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceshellui5/html/wce50lrflistviewstyles.asp
				
				 

3. 插入数据

				
				
				
				      m_list.InsertColumn( 0, "ID", LVCFMT_LEFT, 40 );//插入列
      m_list.InsertColumn( 1, "NAME", LVCFMT_LEFT, 50 );
      int nRow = m_list.InsertItem(0, “11”);//插入行
      m_list.SetItemText(nRow, 1, “jacky”);//设置数据
 

4. 一直选中item

				    选中style中的Show selection always,或者在上面第2点中设置LVS_SHOWSELALWAYS


5. 选中和取消选中一行

    int nIndex = 0;
    //选中
    m_list.SetItemState(nIndex, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
    //取消选中
    m_list.SetItemState(nIndex, 0, LVIS_SELECTED|LVIS_FOCUSED);
 

6. 得到listctrl中所有行的checkbox的状态

      m_list.SetExtendedStyle(LVS_EX_CHECKBOXES);
      CString str;
      for(int i=0; i      {
           if( m_list.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED || m_list.GetCheck(i))
           {
                str.Format(_T("第%d行的checkbox为选中状态"), i);
                AfxMessageBox(str);
           }
      }
				
 

7. 得到listctrl中所有选中行的序号

				
						
      方法一:
      CString str;
      for(int i=0; i      {
           if( m_list.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED )
           {
                str.Format(_T("选中了第%d行"), i);
                AfxMessageBox(str);
           }
      }
      方法二:
      POSITION pos = m_list.GetFirstSelectedItemPosition();
      if (pos == NULL)
           TRACE0("No items were selected!\n");
      else
      {
           while (pos)
           {
                int nItem = m_list.GetNextSelectedItem(pos);
                TRACE1("Item %d was selected!\n", nItem);
                // you could do your own processing on nItem here
           }
      }
				
 

8. 得到item的信息

      TCHAR szBuf[1024];
      LVITEM lvi;
      lvi.iItem = nItemIndex;
      lvi.iSubItem = 0;
      lvi.mask = LVIF_TEXT;
      lvi.pszText = szBuf;
      lvi.cchTextMax = 1024;
      m_list.GetItem(&lvi);
      关于得到设置item的状态,还可以参考msdn文章
      Q173242: Use Masks to Set/Get Item States in CListCtrl
               http://support.microsoft.com/kb/173242/en-us
				
						
 

9. 得到listctrl的所有列的header字符串内容

      LVCOLUMN lvcol;
      char  str[256];
      int   nColNum;
      CString  strColumnName[4];//假如有4列
      nColNum = 0;
      lvcol.mask = LVCF_TEXT;
      lvcol.pszText = str;
      lvcol.cchTextMax = 256;
      while(m_list.GetColumn(nColNum, &lvcol))
      {
           strColumnName[nColNum] = lvcol.pszText;
           nColNum++;
      }
				
 

10. 使listctrl中一项可见,即滚动滚动条

    m_list.EnsureVisible(i, FALSE);

11. 得到listctrl列数

    int nHeadNum = m_list.GetHeaderCtrl()->GetItemCount();

12. 删除所有列

      方法一:
         while ( m_list.DeleteColumn (0))
       因为你删除了第一列后,后面的列会依次向上移动。
      方法二:
      int nColumns = 4;
      for (int i=nColumns-1; i>=0; i--)
          m_list.DeleteColumn (i);
				
 

13. 得到单击的listctrl的行列号

      添加listctrl控件的NM_CLICK消息相应函数
      void CTest6Dlg::OnClickList1(NMHDR* pNMHDR, LRESULT* pResult)
      {
           // 方法一:
           /*
           DWORD dwPos = GetMessagePos();
           CPoint point( LOWORD(dwPos), HIWORD(dwPos) );
  
           m_list.ScreenToClient(&point);
  
           LVHITTESTINFO lvinfo;
           lvinfo.pt = point;
           lvinfo.flags = LVHT_ABOVE;
    
           int nItem = m_list.SubItemHitTest(&lvinfo);
           if(nItem != -1)
           {
                CString strtemp;
                strtemp.Format("单击的是第%d行第%d列", lvinfo.iItem, lvinfo.iSubItem);
                AfxMessageBox(strtemp);
           }
          */
  
          // 方法二:
          /*
           NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
           if(pNMListView->iItem != -1)
           {
                CString strtemp;
                strtemp.Format("单击的是第%d行第%d列",
                                pNMListView->iItem, pNMListView->iSubItem);
                AfxMessageBox(strtemp);
           }
          */
           *pResult = 0;
      }
 

14. 判断是否点击在listctrl的checkbox上

      添加listctrl控件的NM_CLICK消息相应函数
      void CTest6Dlg::OnClickList1(NMHDR* pNMHDR, LRESULT* pResult)
      {
           DWORD dwPos = GetMessagePos();
           CPoint point( LOWORD(dwPos), HIWORD(dwPos) );
  
           m_list.ScreenToClient(&point);
  
           LVHITTESTINFO lvinfo;
           lvinfo.pt = point;
           lvinfo.flags = LVHT_ABOVE;
    
           UINT nFlag;
           int nItem = m_list.HitTest(point, &nFlag);
           //判断是否点在checkbox上
           if(nFlag == LVHT_ONITEMSTATEICON)
           {
                AfxMessageBox("点在listctrl的checkbox上");
           }
           *pResult = 0;
      }
				
 

15. 右键点击listctrl的item弹出菜单

      添加listctrl控件的NM_RCLICK消息相应函数
      void CTest6Dlg::OnRclickList1(NMHDR* pNMHDR, LRESULT* pResult)
      {
           NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
           if(pNMListView->iItem != -1)
           {
                DWORD dwPos = GetMessagePos();
                CPoint point( LOWORD(dwPos), HIWORD(dwPos) );
   
                CMenu menu;
                VERIFY( menu.LoadMenu( IDR_MENU1 ) );
                CMenu* popup = menu.GetSubMenu(0);
                ASSERT( popup != NULL );
                popup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this );
           }
           *pResult = 0;
  }
				
 
 

16. item切换焦点时(包括用键盘和鼠标切换item时),状态的一些变化顺序

      添加listctrl控件的LVN_ITEMCHANGED消息相应函数
      void CTest6Dlg::OnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult)
      {
           NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
           // TODO: Add your control notification handler code here
   
           CString sTemp;
 
           if((pNMListView->uOldState & LVIS_FOCUSED) == LVIS_FOCUSED &&
            (pNMListView->uNewState & LVIS_FOCUSED) == 0)
           {
                sTemp.Format("%d losted focus",pNMListView->iItem);
           }
           else if((pNMListView->uOldState & LVIS_FOCUSED) == 0 &&
               (pNMListView->uNewState & LVIS_FOCUSED) == LVIS_FOCUSED)
           {
                sTemp.Format("%d got focus",pNMListView->iItem);
           }
 
           if((pNMListView->uOldState & LVIS_SELECTED) == LVIS_SELECTED &&
            (pNMListView->uNewState & LVIS_SELECTED) == 0)
           {
                sTemp.Format("%d losted selected",pNMListView->iItem);
           }
           else if((pNMListView->uOldState & LVIS_SELECTED) == 0 &&
            (pNMListView->uNewState & LVIS_SELECTED) == LVIS_SELECTED)
           {
                sTemp.Format("%d got selected",pNMListView->iItem);
           }
   
           *pResult = 0;
      }
				

 

17. 得到另一个进程里的listctrl控件的item内容

				
				
				
						http://www.codeproject.com/threads/int64_memsteal.asp
				
				


18. 选中listview中的item

Q131284: How To Select a Listview Item Programmatically
http://support.microsoft.com/kb/131284/en-us


19. 如何在CListView中使用CListCtrl的派生类

				
						http://www.codeguru.com/cpp/controls/listview/introduction/article.php/c919/
				
				
				
						
 

20. listctrl的subitem添加图标

      m_list.SetExtendedStyle(LVS_EX_SUBITEMIMAGES);
      m_list.SetItem(..); //具体参数请参考msdn
 

21. 在CListCtrl显示文件,并根据文件类型来显示图标

      网上找到的代码,share
      BOOL CTest6Dlg::OnInitDialog()
      {
           CDialog::OnInitDialog();
  
           HIMAGELIST himlSmall;
           HIMAGELIST himlLarge;
           SHFILEINFO sfi;
           char  cSysDir[MAX_PATH];
           CString  strBuf;
 
           memset(cSysDir, 0, MAX_PATH);
  
           GetWindowsDirectory(cSysDir, MAX_PATH);
           strBuf = cSysDir;
           sprintf(cSysDir, "%s", strBuf.Left(strBuf.Find("\\")+1));
 
           himlSmall = (HIMAGELIST)SHGetFileInfo ((LPCSTR)cSysDir, 
                      0, 
                      &sfi,
                      sizeof(SHFILEINFO), 
                      SHGFI_SYSICONINDEX | SHGFI_SMALLICON );
  
           himlLarge = (HIMAGELIST)SHGetFileInfo((LPCSTR)cSysDir, 
                      0, 
                      &sfi, 
                      sizeof(SHFILEINFO), 
                      SHGFI_SYSICONINDEX | SHGFI_LARGEICON);
  
           if (himlSmall && himlLarge)
           {
                ::SendMessage(m_list.m_hWnd, LVM_SETIMAGELIST,
                             (WPARAM)LVSIL_SMALL, (LPARAM)himlSmall);
                ::SendMessage(m_list.m_hWnd, LVM_SETIMAGELIST,
                             (WPARAM)LVSIL_NORMAL, (LPARAM)himlLarge);
           }
           return TRUE;  // return TRUE  unless you set the focus to a control
      }
 
      void CTest6Dlg::AddFiles(LPCTSTR lpszFileName, BOOL bAddToDocument)
      {
           int nIcon = GetIconIndex(lpszFileName, FALSE, FALSE);
           CString strSize;
           CFileFind filefind;
 
           //  get file size
           if (filefind.FindFile(lpszFileName))
           {
                filefind.FindNextFile();
                strSize.Format("%d", filefind.GetLength());
           }
           else
                strSize = "0";
  
           // split path and filename
           CString strFileName = lpszFileName;
           CString strPath;
 
           int nPos = strFileName.ReverseFind('\\');
           if (nPos != -1)
           {
                strPath = strFileName.Left(nPos);
                strFileName = strFileName.Mid(nPos + 1);
           }
  
           // insert to list
           int nItem = m_list.GetItemCount();
           m_list.InsertItem(nItem, strFileName, nIcon);
           m_list.SetItemText(nItem, 1, strSize);
           m_list.SetItemText(nItem, 2, strFileName.Right(3));
           m_list.SetItemText(nItem, 3, strPath);
      }
 
      int CTest6Dlg::GetIconIndex(LPCTSTR lpszPath, BOOL bIsDir, BOOL bSelected)
      {
           SHFILEINFO sfi;
           memset(&sfi, 0, sizeof(sfi));
  
           if (bIsDir)
           {
            SHGetFileInfo(lpszPath, 
                         FILE_ATTRIBUTE_DIRECTORY, 
                         &sfi, 
                         sizeof(sfi), 
                         SHGFI_SMALLICON | SHGFI_SYSICONINDEX |
                         SHGFI_USEFILEATTRIBUTES |(bSelected ? SHGFI_OPENICON : 0)); 
            return  sfi.iIcon;
           }
           else
           {
            SHGetFileInfo (lpszPath, 
                         FILE_ATTRIBUTE_NORMAL, 
                         &sfi, 
                         sizeof(sfi), 
                         SHGFI_SMALLICON | SHGFI_SYSICONINDEX | 
                         SHGFI_USEFILEATTRIBUTES | (bSelected ? SHGFI_OPENICON : 0));
            return   sfi.iIcon;
           }
           return  -1;
      }
				
 

22. listctrl内容进行大数据量更新时,避免闪烁

      m_list.SetRedraw(FALSE);
      //更新内容
      m_list.SetRedraw(TRUE);
      m_list.Invalidate();
      m_list.UpdateWindow();
 
或者参考
				
						http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cwnd.3a3a.setredraw.asp
				
				
				
						
 

23. listctrl排序

Q250614:How To Sort Items in a CListCtrl in Report View
http://support.microsoft.com/kb/250614/en-us
				
						
 

24. 在listctrl中选中某个item时动态改变其icon或bitmap

Q141834: How to change the icon or the bitmap of a CListCtrl item in Visual C++
http://support.microsoft.com/kb/141834/en-us


25. 在添加item后,再InsertColumn()后导致整列数据移动的问题

Q151897: CListCtrl::InsertColumn() Causes Column Data to Shift 
http://support.microsoft.com/kb/151897/en-us
				
						
 

26. 关于listctrl第一列始终居左的问题

解决办法:把第一列当一个虚列,从第二列开始插入列及数据,最后删除第一列。
     
具体解释参阅   http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listview/structures/lvcolumn.asp
				
				 

27. 锁定column header的拖动

				
						http://msdn.microsoft.com/msdnmag/issues/03/06/CQA/
				
				
				
						
 

28. 如何隐藏clistctrl的列

    把需隐藏的列的宽度设为0,然后检测当该列为隐藏列时,用上面第27点的锁定column 的拖动来实现

29. listctrl进行大数据量操作时,使用virtual list   

				
						http://www.codeguru.com/cpp/controls/listview/advanced/article.php/c4151/
				
				
http://www.codeproject.com/listctrl/virtuallist.asp
				
						
 

30. 关于item只能显示259个字符的问题

解决办法:需要在item上放一个edit。
				
 

31. 响应在listctrl的column header上的鼠标右键单击

Q125694: How To Find Out Which Listview Column Was Right-Clicked
http://support.microsoft.com/kb/125694/en-us
				
						
 

32. 类似于windows资源管理器的listview

Q234310: How to implement a ListView control that is similar to Windows Explorer by using DirLV.exe
http://support.microsoft.com/kb/234310/en-us
				
				 

33. 在ListCtrl中OnTimer只响应两次的问题

Q200054:
PRB: OnTimer() Is Not Called Repeatedly for a List Control
http://support.microsoft.com/kb/200054/en-us

34. 以下为一些为实现各种自定义功能的listctrl派生类

          (1)    拖放        
                   http://www.codeproject.com/listctrl/dragtest.asp
                   在CListCtrl和CTreeCtrl间拖放
                   http://support.microsoft.com/kb/148738/en-us
 
          (2)    多功能listctrl
                   支持subitem可编辑,图标,radiobutton,checkbox,字符串改变颜色的类
                   http://www.codeproject.com/listctrl/quicklist.asp
 
                   支持排序,subitem可编辑,subitem图标,subitem改变颜色的类
                   http://www.codeproject.com/listctrl/ReportControl.asp
          (3)    subitem中显示超链接
                   http://www.codeproject.com/listctrl/CListCtrlLink.asp
          (4)    subitem的tooltip提示
                   http://www.codeproject.com/listctrl/ctooltiplistctrl.asp
          (5)    subitem中显示进度条    
                   http://www.codeproject.com/listctrl/ProgressListControl.asp
                   http://www.codeproject.com/listctrl/napster.asp
                   http://www.codeguru.com/Cpp/controls/listview/article.php/c4187/
          (6)    动态改变subitem的颜色和背景色
                    http://www.codeproject.com/listctrl/highlightlistctrl.asp
                    http://www.codeguru.com/Cpp/controls/listbox/colorlistboxes/article.php/c4757/
 
          (7)    类vb属性对话框
                    http://www.codeproject.com/listctrl/propertylistctrl.asp
                    http://www.codeguru.com/Cpp/controls/listview/propertylists/article.php/c995/
                    http://www.codeguru.com/Cpp/controls/listview/propertylists/article.php/c1041/
 
          (8)    选中subitem(只高亮选中的item)
                    http://www.codeproject.com/listctrl/SubItemSel.asp
                    http://www.codeproject.com/listctrl/ListSubItSel.asp
 
          (9)    改变行高
                    http://www.codeproject.com/listctrl/changerowheight.asp
 
          (10)   改变行颜色
                    http://www.codeproject.com/listctrl/coloredlistctrl.asp
 
          (11)   可编辑subitem的listctrl
                    http://www.codeproject.com/listctrl/nirs2000.asp
                    http://www.codeproject.com/listctrl/editing_subitems_in_listcontrol.asp
 
          (12)   subitem可编辑,插入combobox,改变行颜色,subitem的tooltip提示
                    http://www.codeproject.com/listctrl/reusablelistcontrol.asp
 
          (13)   header 中允许多行字符串
                    http://www.codeproject.com/listctrl/headerctrlex.asp
 
          (14)   插入combobox
                    http://www.codeguru.com/Cpp/controls/listview/editingitemsandsubitem/article.php/c979/
 
          (15)   添加背景图片
                    http://www.codeguru.com/Cpp/controls/listview/backgroundcolorandimage/article.php/c4173/
                    http://www.codeguru.com/Cpp/controls/listview/backgroundcolorandimage/article.php/c983/
                    http://www.vchelp.net/vchelp/archive.asp?type_id=9&class_id=1&cata_id=1&article_id=1088&search_term=
   
          (16)  自适应宽度的listctrl
                    http://www.codeproject.com/useritems/AutosizeListCtrl.asp
          (17)  改变ListCtrl高亮时的颜色(默认为蓝色)
                   处理 NM_CUSTOMDRAW
          
http://www.codeproject.com/listctrl/lvcustomdraw.asp

				
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////






m_mm_host_ListCtrl.DeleteAllItems()


m_mm_host_ListCtrl.ModifyStyle(0,LVS_REPORT);
 ////////////
 LONG lStyle = m_mm_host_ListCtrl.SendMessage(
        LVM_GETEXTENDEDLISTVIEWSTYLE);
 lStyle |= LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES |
    LVS_EX_HEADERDRAGDROP;
 m_mm_host_ListCtrl.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0,
   (LPARAM)lStyle);






 ////////////

 或者:
LONG lStyle;
 lStyle = GetWindowLong(m_mm_host_ListCtrl.m_hWnd, GWL_STYLE);//获取当前窗口style
 lStyle &= ~LVS_TYPEMASK; //清除显示方式位
 lStyle |= LVS_REPORT; //设置style
 SetWindowLong(m_mm_host_ListCtrl.m_hWnd, GWL_STYLE, lStyle);//设置style
 
 DWORD dwStyle = m_mm_host_ListCtrl.GetExtendedStyle();
 dwStyle |= LVS_EX_FULLROWSELECT;//选中某行使整行高亮(只适用与report风格的listctrl)
 dwStyle |= LVS_EX_GRIDLINES;//网格线(只适用与report风格的listctrl)
 dwStyle |= LVS_EX_CHECKBOXES;//item前生成checkbox控件
 m_mm_host_ListCtrl.SetExtendedStyle(dwStyle); //设置扩展风格






 /////////////












m_mm_host_ListCtrl.InsertColumn(0,"日志序号",LVCFMT_CENTER,60,0);
 m_mm_host_ListCtrl.InsertColumn(1,"来源",LVCFMT_CENTER,80,1);
 m_mm_host_ListCtrl.InsertColumn(2,"日期",LVCFMT_CENTER,80,2);
 m_mm_host_ListCtrl.InsertColumn(3,"时间",LVCFMT_CENTER,80,3);
 m_mm_host_ListCtrl.InsertColumn(4,"分类",LVCFMT_CENTER,80,4);
 m_mm_host_ListCtrl.InsertColumn(5,"ID",LVCFMT_CENTER,50,5);
 m_mm_host_ListCtrl.InsertColumn(6,"用户",LVCFMT_CENTER,120,6);
 m_mm_host_ListCtrl.InsertColumn(7,"计算机",LVCFMT_CENTER,120,7);


/////////////////////////////////////////////////////////////////////////
				
 

posted @ 2006-08-30 13:31 啤酒 阅读(1327) | 评论 (0)编辑 收藏

用C写的“读取系统日志”,花了我不少时间的,虽然不难

     #include <stdio.h>
//#include <unistd.h>
#include <string.h>
#include <time.h>

#include <windows.h>

#define BUFFER_SIZE 1024*64

//#define DEFAULT_FILE  "C:\\ossec-extracted-evt.log"

FILE *fp;
int event_record=0;


/* Event logging local structure */
typedef struct _os_el
{
    int time_of_last; 
    char *event_name;

    EVENTLOGRECORD *er;
    HANDLE h;

    DWORD record;
}os_el;
os_el el[3];
int el_last = 0;


/** int startEL(char *app, os_el *el)
 * Starts the event logging for each el
 */
int startEL(char *app, os_el *el)
{
    /* Opening the event log */
    el->h = OpenEventLog(NULL, app);
    if(!el->h)
    {
        return(0);    
    }

    el->event_name = app;
    GetOldestEventLogRecord(el->h, &el->record);

    return(1);
}

 

/** char *el_GetCategory(int category_id)
 * Returns a string related to the category id of the log.
 */
//得到一个事件的类型,,输入是一个事件类型id输出是汉字串
char *el_GetCategory(int category_id)
{
    char *cat;
    switch(category_id)
    {
        case EVENTLOG_ERROR_TYPE:
            cat = "错误";
            break;
        case EVENTLOG_WARNING_TYPE:
            cat = "警告";
            break;
        case EVENTLOG_INFORMATION_TYPE:
            cat = "信息";
            break;
        case EVENTLOG_AUDIT_SUCCESS:
            cat = "审核成功";
            break;
        case EVENTLOG_AUDIT_FAILURE:
            cat = "审核失败";
            break;
        default:
            cat = "Unknown";
            break;
    }
    return(cat);
}


/** int el_getEventDLL(char *evt_name, char *event_sourcename, char *event)
 * Returns the event.
 */
int el_getEventDLL(char *evt_name, char *event_sourcename, char *event)
{
    HKEY key;
    DWORD ret;
    char keyname[256];


    keyname[255] = '\0';

    _snprintf(keyname, 254,
            "System\\CurrentControlSet\\Services\\EventLog\\%s\\%s",
            evt_name,
            event_sourcename);

    /* Opening registry */    
    if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyname, 0, KEY_ALL_ACCESS, &key)
            != ERROR_SUCCESS)
    {
        return(0);   
    }


    ret = MAX_PATH -1; 
    if (RegQueryValueEx(key, "EventMessageFile", NULL,
                NULL, (LPBYTE)event, &ret) != ERROR_SUCCESS)
    {
        event[0] = '\0'; 
        return(0);
    }

    RegCloseKey(key);
    return(1);
}

 

/** char *el_Getmessage()
 * Returns a descriptive message of the event.
 */
//输出是时间描述信息
char *el_GetMessage(EVENTLOGRECORD *er,  char *event_name,
      char * event_sourcename, LPTSTR *el_sstring)
{
    DWORD fm_flags = 0;
    char tmp_str[257];
    char event[MAX_PATH +1];
    char *curr_str;
    char *next_str;
    LPSTR message = NULL;

    HMODULE hevt;

    /* Initializing variables */
    event[MAX_PATH] = '\0';
    tmp_str[256] = '\0';

    /* Flags for format event */
    fm_flags |= FORMAT_MESSAGE_FROM_HMODULE;
    fm_flags |= FORMAT_MESSAGE_ALLOCATE_BUFFER;
    fm_flags |= FORMAT_MESSAGE_ARGUMENT_ARRAY;

    /* Get the file name from the registry (stored on event) */
    if(!el_getEventDLL(event_name, event_sourcename, event))
    {
        return(NULL);    
    }    

    curr_str = event;

    /* If our event has multiple libraries, try each one of them */
    while((next_str = strchr(curr_str, ';')))
    {
        *next_str = '\0';
        next_str++;

        ExpandEnvironmentStrings(curr_str, tmp_str, 255);
        hevt = LoadLibraryEx(tmp_str, NULL, DONT_RESOLVE_DLL_REFERENCES);
        if(hevt)
        {
            if(!FormatMessage(fm_flags, hevt, er->EventID,
                        0,
                        (LPTSTR) &message, 0, el_sstring))
            {
                message = NULL;   
            }
            FreeLibrary(hevt);

            /* If we have a message, we can return it */
            if(message)
                return(message);
        }

        curr_str = next_str;  
    }

    ExpandEnvironmentStrings(curr_str, tmp_str, 255);
    hevt = LoadLibraryEx(tmp_str, NULL, DONT_RESOLVE_DLL_REFERENCES);
    if(hevt)
    {
        int hr;   
        if(!(hr = FormatMessage(fm_flags, hevt, er->EventID,
                        0,
                        (LPTSTR) &message, 0, el_sstring)))
        {
            message = NULL;   
        }
        FreeLibrary(hevt);

        /* If we have a message, we can return it */
        if(message)
            return(message);
    }

    return(NULL);
}

 

/** void Read_event(os_el *el)
 * Reads the event log.
 */
void Read_event(os_el *el, int printit)
{
    DWORD nstr;
    DWORD user_size;
    DWORD domain_size;
    DWORD read, needed;
    int size_left;
    int str_size;

    char *mbuffer[BUFFER_SIZE];
    LPSTR sstr = NULL;

    char *tmp_str = NULL;
    char *event_category;   //事件类型
    char *event_sourcename;   //事件来源
    char *event_computername;  //事件计算机名
    char *event_descriptive_msg; //事件描述

    char event_el_user[257];  //事件用户
    char event_el_domain[257];  //事件域
    char el_string[1025];
    char final_out_msg[1024];  //最后输出的信息
    LPSTR el_sstring[57];

    /* Er must point to the mbuffer */
    el->er = (EVENTLOGRECORD *) &mbuffer;

    /* Zeroing the last values */
    el_string[1024] = '\0';
    event_el_user[256] = '\0';
    event_el_domain[256] = '\0';
    final_out_msg[1023] = '\0';
    el_sstring[56] = NULL;

    /* Reading the event log */    
    while(ReadEventLog(el->h,
                EVENTLOG_FORWARDS_READ | EVENTLOG_SEQUENTIAL_READ,
                0,
                el->er, BUFFER_SIZE -1, &read, &needed))
    {
        while(read > 0)
        {

            /* We need to initialize every variable before the loop */
   //得到事件的类型
            event_category = el_GetCategory(el->er->EventType);
   //得到事件来源
            event_sourcename = (LPSTR) ((LPBYTE) el->er + sizeof(EVENTLOGRECORD));
   //得到计算机名
            event_computername = event_sourcename + strlen(event_sourcename) + 1;
   //给描述信息初始化
            event_descriptive_msg = NULL;


            /* 初始化domain/user尺寸 */
            user_size = 255; domain_size = 255;
            event_el_domain[0] = '\0';
            event_el_user[0] = '\0';


            /* 设置时间的一些描述 some description */
            if(el->er->NumStrings)
            { 
                size_left = 1020; 

                sstr = (LPSTR)((LPBYTE)el->er + el->er->StringOffset);
                el_string[0] = '\0';

                for (nstr = 0;nstr < el->er->NumStrings;nstr++)
                {
                    str_size = strlen(sstr); 
                    strncat(el_string, sstr, size_left);

                    tmp_str= strchr(el_string, '\0');
                    if(tmp_str)
                    {
                        *tmp_str = ' ';  
                        tmp_str++; *tmp_str = '\0';
                    }
                    size_left-=str_size + 1;

                    if(nstr <= 54)
                        el_sstring[nstr] = (LPSTR)sstr;

                    sstr = strchr( (LPSTR)sstr, '\0');
                    sstr++;
     
                }

                /* Get a more descriptive message (if available) */
                event_descriptive_msg = el_GetMessage(el->er, el->event_name, event_sourcename, el_sstring);
                if(event_descriptive_msg != NULL)
                {
                    /* Remove any \n or \r */
                    tmp_str = event_descriptive_msg;   
                    while((tmp_str = strchr(tmp_str, '\n')))
                    {
                        *tmp_str = ' ';
                        tmp_str++;
      

     
                    }   

                    tmp_str = event_descriptive_msg;   
                    while((tmp_str = strchr(tmp_str, '\r')))
                    {
                        *tmp_str = ' ';
                        tmp_str++;
      //strchr(tmp_str, '\n');

                    }   
                }
            }
            else
            {
                strncpy(el_string, "(no message)", 1020); 
            }


            /* 得到username */
            if (el->er->UserSidLength)
            {
                SID_NAME_USE account_type;
                if(!LookupAccountSid(NULL, (SID *)((LPSTR)el->er + el->er->UserSidOffset),
                            event_el_user, &user_size, event_el_domain, &domain_size, &account_type))  
                {
                    strncpy(event_el_user, "(no user)", 255);
                    strncpy(event_el_domain, "no domain", 255);
                }

            }

            else
            {
                strncpy(event_el_user, "A", 255); 
                strncpy(event_el_domain, "N", 255); 
            }

            if(printit)
            {
                tm   *event_time   =   localtime((const   long   *)&el->er->TimeWritten);

                _snprintf(final_out_msg, 1022,
                        "事件记录序号:%d\n事件:%s\n日期:%.4hd-%.2hd-%.2hd\n时间: %.2hd:%.2hd:%.2hd\n事件类型:%s\n事件来源:%s\n事件ID:(%u)\n用户:%s/%s\n计算机:%s\n描述:\n%s\n\n\n",
      event_record,
      el->event_name,
      event_time->tm_year   +   1900,
      event_time->tm_mon   +   1,
      event_time->tm_mday,
      event_time->tm_hour,
      event_time->tm_min,
      event_time->tm_sec, 
                        event_category,
      event_sourcename,
                       
                        (WORD)el->er->EventID,
                        event_el_domain,
                        event_el_user,
                       
      event_computername,
                        event_descriptive_msg != NULL?event_descriptive_msg:el_string); 
              
         fprintf(fp, "%s\n", final_out_msg); 
            }

            if(event_descriptive_msg != NULL)
                LocalFree(event_descriptive_msg);

            /* Changing the point to the er */
            read -= el->er->Length;
            el->er = (EVENTLOGRECORD *)((LPBYTE) el->er + el->er->Length);
   event_record++;
        }  

        /* Setting er to the beginning of the buffer */ 
        el->er = (EVENTLOGRECORD *)&mbuffer;
  
    }
}


/** void win_startel()
 * Starts the event logging for windows
 */
void win_startel(char *eventlog)
{
    event_record=1;
 startEL(eventlog, &el[el_last]);
    Read_event(&el[el_last],1);
    el_last++;
}
////////////////////////////////////////////////////////
////main////////////////////////////////////////////////
////////////////////////////////////////////////////////
int main()
{
   fp = fopen("C:\\Documents and Settings\\Administrator\\桌面\\Read_log.txt","w");
   if(!fp)
 {
  printf("Unable to open file\n");
  exit(1);
 }
   else
   {
  printf("open file\n"); 
   }


 fprintf(fp, "\n\n***********安全日志***********\n\n\n"); 
 win_startel("Security");
 printf("安全日志打开\n");

 fprintf(fp, "\n\n***********应用日志***********\n\n\n"); 
 win_startel("Application");
 printf("应用日志打开\n");


 fprintf(fp, "\n\n***********系统日志***********\n\n\n"); 
 win_startel("System");
 printf("系统日志打开\n");

 

 

 fclose(fp);
 if(fclose(fp))
 {
  printf("关闭了\n");
 }
 else
 {
  printf("还开着呢了,,抓紧关它吧\n");
 }
 return(0);
}

posted @ 2006-08-28 14:18 啤酒 阅读(2509) | 评论 (7)编辑 收藏

API函数库

     摘要: 第一章 文件相关的API函数 Api函数名 函数说明 适用范围W16 W95 WNTmmioWrite 写文件 否 是 是WriteFile 写文件 否 是 是ExtractAssociatedIcon 从文件或相关EXE中获取图标句柄 否 是 是ExtractIcon 从可执行文件中返回图标句柄 否 是 是LZRead 从压缩文件中读入数据 是 是 是GetPrivateProfileStr...  阅读全文

posted @ 2006-08-22 11:57 啤酒 阅读(1908) | 评论 (1)编辑 收藏

小节

如何实现繁简体互换?

// j2f.cpp : 简体(gb)==>繁体==>big5的过程
// 反向转换是类似的.
// 注意直接从简体-->big5不能做到一一对应.会有很多?出现,
// 故此需要先转成繁体.再转成big5.
// 我感觉这种方法应当和winnt或office里提供的繁简或字符集互转是一致的.

#include "stdafx.h"
#include
#include
#include
#include
#include
using namespace std;

void j2f(const string &s)
{
 int n=s.length ();
 int r=LCMapString(
   MAKELCID(MAKELANGID(LANG_CHINESE,SUBLANG_CHINESE_SIMPLIFIED),SORT_CHINESE_PRC),
   LCMAP_TRADITIONAL_CHINESE,
   s.c_str (),s.length (),NULL,0);
 if (!r) cout <<"error :"<
 char *ft=new char[r+1];
 r=LCMapString(
   MAKELCID(MAKELANGID(LANG_CHINESE,SUBLANG_CHINESE_SIMPLIFIED),SORT_CHINESE_PRC),
   LCMAP_TRADITIONAL_CHINESE,
   s.c_str (),s.length (),ft,r+1);//这个api搞掂简体转繁体,下面会打印繁体出来
 if (r) {
  ft[r]=0;
  cout<
  wchar_t *pws=new wchar_t[r+1];
  int r1=MultiByteToWideChar(936,0,ft,r,pws,r+1);
 BOOL f=FALSE;
 r1=WideCharToMultiByte(950,0,pws,r1,ft,r+1,"?",&f);//代码页切换搞掂gb->big5
 ft[r1]=0;
 cout<<<"(";
  for (int i=0;i    cout<<"";
   printf("0x%02x ",(BYTE)ft[i]);
  }
 cout<<")"<
 delete [] pws;
 }

 delete []ft;
}

//从标准输入简体国标-->big5繁体标准输出,输入两个空行退出
int main(int argc, char* argv[])
{

 for(;;){
  char line[1024];
  cin.getline (line,sizeof(line));
 string s(line);
 if (!cin ||s.length ()==0) break;
 j2f(s);
}
_getch();
return 0;
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1.首先请参阅其他技术专栏中用VB6.0访问注册表,创建
HKEY_LOCAL_MACHINE,\SYSTEM\CurrentControlSet\Services\Eventlog\Eventlog2\Eventlog2键,并且写入EventMessageFile,value为C:\WINNT\Microsoft.NET\Framework\v1.1.4322\EventLogMessages.dll

2.在C#.net使用以下代码写日志
//输出日志的CLASS
using System;
using System.Diagnostics;
using System.Text;

namespace CorePlus.Framework.Utility
{
 /// <summary>
 /// 写日志的CLASS
 /// </summary>
 public class LogUtility
 {
  public enum EVENT
  {
   /// <summary>重大错误</summary>
   EVENT_ERROR,
   /// <summary>操作失败</summary>
   EVENT_FAILUREAUDIT,
   /// <summary>一般信息</summary>
   EVENT_INFORMATION,
   /// <summary>有效的,成功的操作</summary>
   EVENT_SUCCESSAUDIT,
   /// <summary>警告</summary>
   EVENT_WARNING,
  }

  private static TextWriterTraceListener listner = null;

  /// <summary>
  /// 构造函数
  /// </summary>
  public LogUtility () {}

  /// <param name="loginID">登录ID</param>
  /// <param name="screenID">画面ID</param>
  /// <param name="level">警告级别</param>
  /// <param name="message">日志信息</param>
  public static void Logging (
   string loginID,
   string screenID,
   EVENT level,
   string message )
  {
   // 变量定义
   StringBuilder  outputMessage = null; // 输出的信息
   string    targetLevelString = null;
   EventLogEntryType Eventtype = new EventLogEntryType();

   switch (level)
   {
    case EVENT.EVENT_ERROR:
     Eventtype = EventLogEntryType.Error;
     break;

    case EVENT.EVENT_FAILUREAUDIT:
     Eventtype = EventLogEntryType.FailureAudit;
     break;

    case EVENT.EVENT_INFORMATION:
     Eventtype = EventLogEntryType.Information;
     break;

    case EVENT.EVENT_SUCCESSAUDIT:
     Eventtype = EventLogEntryType.SuccessAudit;
     break;

    case EVENT.EVENT_WARNING:
     Eventtype = EventLogEntryType.Warning;
     break;
   }

   // 日志信息的拼合
   outputMessage = MakeMessage( loginID, screenID, targetLevelString, message );

   // 写日志
   Logging( Eventtype, outputMessage.ToString() );
  }

  /// <summary>
  /// 向日志管理器写日志
  /// </summary>
  /// <param name="level">错误级别</param>
  /// <param name="message">输出的信息</param>
  private static void Logging ( EventLogEntryType level, string message )
  {
   // 变量定义
   string  logName  = null; // 日志名
   string  machineName = null; // 机器名
   string  sourceName = null; // SourceName
   EventLog eventLog = null; // EventLog

   logName  = "Eventlog2";  // 日志名
   machineName = "."; // 机器名
   sourceName = "Eventlog2"; // SourceName

   eventLog = new EventLog( logName, machineName, sourceName );
   eventLog.WriteEntry( message,level );
   eventLog = null;
  }

  /// <summary>
  /// 日志最终拼合
  /// </summary>
  /// <param name="loginID">登录ID</param>
  /// <param name="screenID">画面ID</param>
  /// <param name="levelString">错误级别</param>
  /// <param name="message">日志信息</param>
  /// <returns>输出的日志信息</returns>
  private static StringBuilder MakeMessage (
   string loginID,
   string screenID,
   string levelString,
   string message )
  {
   // 变量定义
   StringBuilder retMessage = new StringBuilder();

   retMessage.Append( "【登录ID】" );
   retMessage.Append( loginID );
   retMessage.Append( "\n【画面ID】" );
   retMessage.Append( screenID );
   retMessage.Append( "\n【错误级别】" );
   retMessage.Append( levelString );
   retMessage.Append( "\n【错误信息】\n" );
   retMessage.Append( message );

   return retMessage;
    }
  }
}

// 在FORM中输出日志
  private void button1_Click(object sender, System.EventArgs e)
  {
   LogUtility.Logging( "bbbbbb","22222222",LogUtility.EVENT.EVENT_ERROR,"3333333" );
  }

运行完程序后打开日志管理器看看~~~~~~~~~怎么样?不错吧,呵呵.

 

 

 


////////////////////////////////////////////////////////////////////////////
1.窗口信息

  MS为我们提供了打开特定桌面和枚举桌面窗口的函数。
  hDesk=OpenDesktop(lpszDesktop,0,FALSE,DESKTOP_ENUMERATE);
  //打开我们默认的Default桌面;
  EnumDesktopWindows(hDesk,(WNDENUMPROC)EnumWindowProc,0);
  //枚举打开桌面上的所有窗口,由回调函数实现。
  BOOL __stdcall EnumWindowProc(HWND, LPARAM);
  //在回调函数中,我们可以获得窗口的标题和相关进程,线程信息;
  GetWindowText(hWnd,szWindowText,dwMaxCount);
  GetWindowThreadProcessId(hWnd,&dwPID);

  2.设备驱动器信息(服务和设备驱动器差不多,在此不做重复)

  设备驱动信息有服务控制管理器(SCM)来管理的,我要打开服务控制管理器,并枚举所有的设备驱动器。
  OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS);
  //以所有权限打开服务控制管理器;
  EnumServicesStatus(schManager,dwDeviceType,dwDeviceState,
        EnumStatus,dwBufSize,&dwBytesNeeded,
       &dwDevicesReturned,&dwResumeHandle))
  //枚举所有设备的当前状态;
  CloseServiceHandle(schManager);
  //记住,在结束访问后要关闭服务句柄;
  OpenService(schManager,szDeviceName,SERVICE_ALL_ACCESS);
  //打开特定的设备驱动器;
  QueryServiceConfig(schDevice,lpDeviceConfig,
             1024*8,&dwBytesNeeded);
  //查询驱动器的服务配置信息;
  QueryServiceStatus(schDevice,&DeviceStatus);
  //查询设备驱动器的当前状态;
  QueryServiceConfig2(schDevice,SERVICE_CONFIG_DESCRIPTION,
  (LPBYTE)lpDeviceDescription,8*1024,&dwBytesNeeded)
  //查询设备的描述信息;
  StartService(schDevice,0,NULL);
  //启动设备;
  ControlService(schDevice,SERVICE_CONTROL_STOP,&DeviceStatus);
  //停止设备;
  DeleteService(schDevice);
  //删除设备;

  3.磁盘信息

  我们希望获得系统所有磁盘的信息,包括软盘,硬盘,光盘等等;
  GetLogicalDriveStrings(dwBufferLength,lpBuffer);
  //获得逻辑设备的信息;
  GetVolumeInformation(lpRootPathName,lpVolumeNameBuffer,
   dwVolumeNameSize,&dwVolumeSerialNumber,
   &dwMaximumComponentLength,&dwFileSystemFlags,
      lpFileSystemNameBuffer,dwFileSystemNameSize);
  //获得磁盘卷信息,包括卷名称和格式类型;
  GetDiskFreeSpaceEx(lpRootPathName,&FreeBytesAvailable,
          &TotalNumberOfBytes,&TotalNumberOfFreeBytes);
  //探测磁盘的空间使用情况;

  4.环境变量

  我们可以从注册表中获得环境块的信息:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment,当然要使用注册表的函数。
  RegOpenKeyEx(HKEY_LOCAL_MACHINE,RegKey,0,KEY_QUERY_VALUE,&hKey);
  //打开注册表的键;
  RegEnumValue(hKey,dwIndex,EnvironVariable,
         &dwVariableLength,NULL,NULL,NULL,NULL);
  //查询我们需要的信息值;
  GetEnvironmentVariable(EnvironVariable,EnvironString,1024);
  //获得环境变量的字符串信息;

 

 

5.事件记录信息

  OpenEventLog(NULL,szLog);
  //打开时间日志记录;
  GetOldestEventLogRecord(hEvent,&dwThisRecord);
  //获得最新的日志信息,以便继续查找;
  ReadEventLog(hEvent,EVENTLOG_FORWARDS_READ │ EVENTLOG_SEQUENTIAL_READ,
   0,pEventLogRecord,1024*32,&dwRead,&dwNeeded)
  //读去日志信息;
  LookupAccountSid(NULL,pSid,szName,&dwName,szDomain,&dwDomain,&SNU);
  //获取账户的SID,以便获得账户的用户名称;
  GetNumberOfEventLogRecords(hEvent,&dwTotal);
  //获得事件日志的总数;
  CloseEventLog(hEvent);
  //不要忘记关闭事件句柄;
  
  6.网络共享

  我们使用第二等级的网络共享搜索;
  NetShareEnum(NULL,dwLevel,(PBYTE *)&pBuf,MAX_PREFERRED_LENGTH,&entriesread,&totalentries,&resume);
  //列举所有的共享目录及相关信息;
  NetApiBufferFree(pBuf);
  //释放缓冲区;
  NetShareDel(NULL,(char *)lpShareNameW,0);
  //删除网络共享目录;
  
  7.网络适配器信息

  我们要探测NIC的信息和网络流量;
  GetAdaptersInfo(&AdapterInfo,&OutBufLen);
  //获取适配器信息;
  
  8.系统性能

  获取系统的存储器使用情况;
  GetPerformanceInfo(&PerfInfo,sizeof(PERFORMACE_INFORMATION))
  //获取系统性能信息;

  9.进程/线程/模块信息

  在此我们使用工具帮助函数(ToolHelp32)和系统
  OpenProcessToken(GetCurrentProcess(),TOKEN_QUERY │ TOKEN_ADJUST_PRIVILEGES,&hToken);
  //打开进程的令牌,提升权限;
  AdjustTokenPrivileges(hToken,FALSE,&TokenPrivileges,sizeof(TOKEN_PRIVILEGES),NULL,NULL);
  //将进程的权限提升到支持调试(Debug);
  CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
  //创建进程的快照;
  Process32First(hProcessSnap,&ProcessEntry32);
  Process32First(hProcessSnap,&ProcessEntry32);
  //枚举所有进程;
  OpenProcess(PROCESS_QUERY_INFORMATION,FALSE,ProcessEntry32.th32ProcessID);
  //打开特定进程,以查询进程相关信息;
  GetProcessTimes(hProcess,&CreateTime,&ExitTime,&KernelTime,&UserTime);
  //获取进程的时间信息;
  GetProcessMemoryInfo(hProcess,&PMCounter,sizeof(PMCounter));
  //获取进程的存储区信息;
  GetPriorityClass(hProcess);
  //获取进程的优先权;
  GetProcessIoCounters(hProcess,&IoCounters);
  //获取进程的IO使用情况;
  CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessID);
  //创建模块快照;
  Module32First(hModuleSnap, &ModuleEntry32);
  Module32Next(hModuleSnap, &ModuleEntry32);
  //枚举进程模块信息;
  CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
  //创建线程快照;
  Thread32First(hThreadSnap, &ThreadEntry32);
  Thread32Next(hThreadSnap, &ThreadEntry32);
  //枚举线程信息;
  OpenThread(THREAD_ALL_ACCESS,FALSE,ThreadEntry32.th32ThreadID);
  //打开线程,须自己获得此函数地址;
  TerminateProcess(hProcess,0);
  //终止进程;
  SuspendThread(hThread);
  //悬挂线程;
  ResumeThread(hThread);
  //激活线程;

 

 

10.关机

  AdjustTokenPrivileges(hToken,FALSE,&TokenPrivileges,sizeof(TOKEN_PRIVILEGES),NULL,NULL);
  //调整进程令牌,使其支持关机;
  ExitWindowsEx(EWX_LOGOFF,0);
  //注销系统;
  LockWorkStation();
  //锁定系统;
  InitiateSystemShutdown(NULL,szMessage,dwTimeout,FALSE,bSig);
  //支持到记时和消息显示的关机/重启;
  SetSystemPowerState(bSig,FALSE);
  //系统休眠/冬眠;

  11.用户信息

  NetUserEnum(NULL,dwLevel,FILTER_NORMAL_ACCOUNT,(LPBYTE*)&pBuf,       dwPrefMaxLen,&dwEntriesRead,&dwTotalEntries,&dwResumeHandle);
  //枚举系统用户信息;
  NetUserDel(NULL,lpUserNameW);
  //删除指定用户;
 
  12.系统版本信息

  GetVersionEx((LPOSVERSIONINFO)&osviex);
  //获取操作系统的版本信息;
  我们也可以通过注册表(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion)获取相关信息:
  GetTickCount();
  //获取开机时间;
  GetComputerName(szInfo,&dwInfo);
  //获取计算机名称;
  GetUserName(szInfo,&dwInfo);
  //获取计算机用户名;
  GetWindowsDirectory(szInfo,MAX_PATH+1);
  //获取Windows目录;
  GetSystemDirectory(szInfo,MAX_PATH+1);
  //获取系统目录;

/////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
事件记录信息
  OpenEventLog(NULL,szLog);
  //打开时间日志记录;
  GetOldestEventLogRecord(hEvent,&dwThisRecord);
  //获得最新的日志信息,以便继续查找;
  ReadEventLog(hEvent,EVENTLOG_FORWARDS_READ │ EVENTLOG_SEQUENTIAL_READ,
   0,pEventLogRecord,1024*32,&dwRead,&dwNeeded)
  //读去日志信息;
  LookupAccountSid(NULL,pSid,szName,&dwName,szDomain,&dwDomain,&SNU);
  //获取账户的SID,以便获得账户的用户名称;
  GetNumberOfEventLogRecords(hEvent,&dwTotal);
  //获得事件日志的总数;
  CloseEventLog(hEvent);
  //不要忘记关闭事件句柄;

posted @ 2006-08-22 10:56 啤酒 阅读(764) | 评论 (0)编辑 收藏

技术网站

 

A:http://www.csdn.net                   http://www.codeguru.com

http://www.vccode.com                 http://www.codeproject.com

http://www.vckbase.com                http://www.vchelp.net

http://www.bc-cn.net/bbs/Article/55_71.html

http://www.leftworld.net/online/index.html  左岸贵族
http://www.acfile.com/    进程管理知识库
http://topic.csdn.net   CSDN知识库
http://www.popbook.com/Wbbs/topic.asp?l_id=5&t_id=2252   API函数库
http://bczs.net/
http://www.bczs.net/xml/2006/3/30/4650310.xml
http://www.vckbase.com/code/listcode.asp?mclsid=3&sclsid=323
http://dev.csdn.net/author/starlee/8522073c8f034264a026dd78dbfa2feb.html         自动改变控件类

posted @ 2006-08-17 15:26 啤酒 阅读(160) | 评论 (0)编辑 收藏

我收藏的网站

实战销售演练 汤姆.霍普金斯 6张VCD下载http://www.success-life.org
如何达至事业顶峰 汤姆·霍普金斯 12张CD下载
http://www.success-life.org
掌纹医学入门 王晨霞 1张VCD下载
http://www.success-life.org
人际关系与沟通艺术 王琳 2张CD下载
http://www.success-life.org
超脑力记忆训练 倪新威 6张VCD下载
http://www.success-life.org
北京超级富豪演讲会 王宗立 3张VCD下载
http://www.success-life.org
自我推销与个人公关 王琳 1张VCD下载
http://www.success-life.org
手诊讲座 王守志 5张VCD下载
http://www.success-life.org
成功的项目管理 蔚林巍 13张VCD免费bt下载
http://www.success-life.org
现代企业战略管理实务与案例分析 吴维库 10张VCD压缩成3张RM格式光盘下载
http://www.success-life.org
超越自我 寿险销售实战经验分享 吴学文 4张VCD
反败为胜--销售改变一生 夏目志郎 1张RM格式光盘下载
http://www.success-life.org
产品太多,以上无法一一列出,详细清单请访问成功人生网
http://www.success-life.org/all.html 或 成功网 http://www.success01.net/all.html
绩效评估与面谈技巧 杜继南 6张VCD下载http://www.success-life.org
客户管理与帐款回收操作实务 谢旭、刘建清 15张VCD下载
http://www.success-life.org
听陈明莉讲故事 3张VCD压缩成1张RM格式光盘下载
http://www.success-life.org
如何打造百年企业-企业高层的超级修炼 邢以群 9张VCD下载
http://www.success-life.org
生命的灵性 许宜铭 6张VCD下载
http://www.success-life.org
生命潜能--智慧之旅 许宜铭 10张CD下载
http://www.success-life.org
《海尔真相》完整版 薛旭 28张VCD下载
http://www.success-life.org
性格的力量-超越卓越的你 杨滨 2张VCD下载
http://www.success-life.org
促销员职业化训练 叶建华 6张VCD下载
http://www.success-life.org
告诉你成功一定有方法 易发久 4张VCD下载
http://www.success-life.org
岗位说明书的编写与应用 尹隆森 5张VCD压缩成1张RM格式光盘下载
http://www.success-life.org
柜台销售技巧 柳青 6张VCD下载
http://www.success-life.org
现代企业规范化管理整体解决方案 尹隆森 24张VCD压缩成5张RM格式光盘下载
http://www.success-life.org
领导商数 余世维 6张VCD下载
http://www.success-life.org
赢在执行-余世维 6张VCD压缩成2张RM光盘下载
如何成为一个成功的职业经理人 余世维 6张VCD下载
http://www.success-life.org
职业经理人常犯的11个错误 余世维 6张VCD下载
http://www.success-life.org
有效管理者的八大工具 宋新宇 8张VCD下载
http://www.success-life.org
别对自己说不可能 约翰.库绨斯 1张VCD下载
http://www.success-life.org
餐厅服务员基础培训 曾凤茹等 1张VCD下载
http://www.success-life.org
非财务人员的财务管理--操作实务 曾建斌 16张VCD下载
http://www.success-life.org
中国式管理-组织行为学 曾仕强 15张VCD 125元
总裁领导学 曾仕强 12张VCD下载
http://www.success-life.org
营销久赢的八大方法 宋新宇 8张VCD下载
http://www.success-life.org
曾仕强点评胡雪岩成功之道 曾仕强 48张VCD 250元
中国式管理-人际关系学 曾仕强 8张VCD下载
http://www.success-life.org
超世纪大易管理 曾仕强教授 6张VCD下载
http://www.success-life.org
如何做一个杰出的好领导 张锦贵 10张VCD下载
http://www.success-life.org
如何处理人际关系 张锦贵 3张VCD下载
http://www.success-life.org
谈判技巧 张锦贵 3张VCD下载
http://www.success-life.org
辞退员工管理与辞退面谈技巧 程向阳 4张VCD免费bt下载
http://www.success-life.org
金牌导购员(促销员)实战销售技巧 王荣耀 12张VCD下载
http://www.success-life.org
经营管理系列 张锦贵 11张VCD下载
http://www.success-life.org
实战销售系列 张锦贵 13张VCD下载
http://www.success-life.org
寻找客户的26条渠道 范云峰 8张VCD下载
http://www.success-life.org
成功人生系列 张锦贵 12张VCD下载
http://www.success-life.org
海尔的管理学习和创新 张瑞敏 3张VCD压缩成1张RM格式光盘下载
http://www.success-life.org
学习型组织管理 张声雄 11张VCD下载
http://www.success-life.org
21世纪星级酒店管理秘诀首度大揭秘 张声雄 4张VCD下载
http://www.success-life.org
超级业务员专业销售技巧讲座 张伟 17张VCD下载
http://www.success-life.org
招聘与面试技巧 张晓彤 6张VCD压缩成1张RM格式光盘下载
http://www.success-life.org
如何选、育、用、留人才 张晓彤 13张VCD下载
http://www.success-life.org
张孝祥Java就业培训教程 8张高清晰RM格式光盘下载
http://www.success-life.org
电话销售技巧 张煊搏 5张VCD下载
http://www.success-life.org
全脑开发大师 我是天才 2张CD下载
http://www.success-life.org
章义伍-共赢领导力 章义伍 7张VCD下载http://www.success-life.org
职业经理十项管理技能训练 章哲 12张VCD下载
http://www.success-life.org
素描起步 浙江电子音像出版社 1张VCD下载
http://www.success-life.org
项目计划与进度管理 中国科学院 5张VCD下载
http://www.success-life.org
与成功对话——商界名人访谈录 中央电视台 12张CD压缩成2张mp3光盘下载
中央电视台:对话 30张VCD压缩成3张RM格式光盘下载
http://www.success-life.org
成事在人--企业领导艺术 钟刚 14张VCD 下载
超级推销(钟刚主持) 13张VCD下载
http://www.success-life.org
产品太多,以上无法一一列出,详细清单请访问成功人生网
http://www.success-life.org/all.html 或 成功网 http://www.success01.net/all.html
家长培训班讲课实录 周弘 4张VCD免费bt下载http://www.success-life.org
赏识教育你的孩子 周弘 6张VCD下载
http://www.success-life.org
新地产兵法 专家团 10张VCD下载
http://www.success-life.org
面对面顾问式销售 周嵘 6张VCD下载http://www.success-life.org
中国服饰零售案例 祝文欣 5张VCD下载
http://www.success-life.org
现代美容化妆技法 毛戈平 2张VCD免费bt下载
http://www.success-life.org
怎样画卡通 布里茨 6张VCD下载
http://www.success-life.org
全脑开发大师 理想的体重 2张CD下载
http://www.success-life.org
全脑开发大师 全套20辑 40张CD 600元
孙鑫VC++视频教学 8张RM格式光盘下载
http://www.success-life.org
中国大百科全书 4张光盘下载
零起点学漫画 2张光盘下载
当代交谊舞教程 6张VCD压缩成1张RM格式光盘免费bt下载
http://www.success-life.org
房地产营销的定位实践 方志华 2张VCD下载
http://www.success-life.org
制造型企业生产主管实践训练 夏祯 8张VCD下载
http://www.success-life.org
胎教音乐精选 1张CD下载
http://www.success-life.org
物流作业系统演示 1张RM视频压缩格式光盘下载
http://www.success-life.org
放松暗示音乐 1张MP3光盘下载
决胜终端--中国服饰品牌加盟商创业宝典 祝文欣 6张VCD下载
http://www.success-life.org
赊销与风险控制 刘宏程 12张VCD下载http://www.success-life.org
中移动(香港)绩效管理系统培训 4张VCD压缩成1张RM格式光盘下载http://www.success-life.org
汽车驾驶学习技巧VCD 2张VCD压缩成1张RM格式光盘下载
http://www.success-life.org
管理者的情商EQ 余世维 6张VCD下载
http://www.success-life.org
EMBA全套学习资料 5张VCD压缩成2张RM格式光盘下载
http://www.success-life.org
分层授权VS分层负责 曾仕强 6张VCD下载
http://www.success-life.org
孙子兵法与人力自动化 曾仕强 7张VCD下载
http://www.success-life.org
保健品发展趋势与营销战略 3张VCD下载
http://www.success-life.org
2000版ISO9000族标准理解与应用 李为柱等 15张VCD免费bt下载
http://www.success-life.org
中国前50名首富创业和致富访谈录 25张VCD下载
http://www.success-life.org
美容师培训大全(高级班初级班) 24张VCD下载
http://www.success-life.org
抗遗忘快速记忆法 4张VCD下载
http://www.success-life.org
辩论技巧与实战 4张VCD压缩成1张RM格式光盘免费bt下载
http://www.success-life.org
企业的经营核算与盈亏分析 3张VCD下载
http://www.success-life.org
全球500强CEO管理秘诀 16张VCD下载
http://www.success-life.org
胎教与儿童潜能精选 4张VCD下载
http://www.success-life.org
1993-2004年国际大专辩论会实况 6张VCD压缩成3张RM格式光盘 免费bt下载
http://www.success-life.org
产品太多,以上无法一一列出,详细清单请访问 成功网
http://www.success01.net/all.html 或成功人生网 http://www.success-life.org/all.html
免费bt下载
http://www.success-life.org,免费视频下载,emule下载。
成功网
http://www.success01.net
成功人生网 http://www.success-life.org

posted @ 2006-08-17 15:01 啤酒 阅读(382) | 评论 (0)编辑 收藏

国内完全免费的电子图书下载网址

搜书网 http://www.chinesebook.com.cn/bjbookfair/index.asp
E书时空
http://www.eshunet.com/
我爱E书
http://www.52ebook.com/
中华电脑书库
http://www.pcbookcn.com/
黄金社区
http://www.kpgb88.net/bbs/
书海      
http://www.booksea.com
时代书城 http://www.mypcera.com/book/
幻剑书盟 http://www.hjsm.net/
中国e书网 http://www.ebookcn.net/index.htm
阅读宝库 http://www.people.com.cn/GB/wenhua/22226/29647/
我爱E书   http://www.52ebook.com/
学习计算机全书 http://www.netyi.net/index.asp
四川省图书馆天府阅览室(须注册) http://lib.sc.cninfo.net/
军事与泥巴  
http://www.warmud.com/c1.htm
中文搜书引擎  
http://www.bookicq.com/
木子书屋  
http://shuwu.com/index2.shtml
ocr书城
http://ocr.tab.net.cn/
阿拉下载  
http://www.booksea.com/
白鹿书院  
http://www.oklink.net/
三思藏书架  
http://www.oursci.org/lib.htm
圣城麦地纳之声  
http://www.makuielys.info/makuielys/index.php
游离空间  
http://www.5soho.com/xp/
学术书斋  
http://time.dufe.edu.cn/xsshuku/xshshuku1.htm
亦凡书库  
http://www.shuku.net/
琵琶行    
http://61.180.86.70/book/
宝藏下载  
http://www.xicn.net/download/ebook/
三味书林  
http://come.6to23.com/fayu/gdwx/index.html
书路    
http://www.shulu.net/
春光书屋  
http://www.starinfo.net.cn/photography/gif/
海天书院  
http://www.0943.com.cn/wenxue/
书吧  
http://www.book8.com/
耕读缘  
http://www.gengdu.com/
浙江大学文化素质网  
http://www.culture.zju.edu.cn/new/p...t_id=1&offset=1
夜网下载  
http://www.yewang.org/ywxz/
佛教导航  
http://www.seach.org/ptwk/default.asp
禅友上载区 >>
http://www.1zen.com/share/index.asp
北京自考热线  
http://bjzhaokao.com/down/list.asp
视野下载  
http://download.esnai.com/asp/default.asp
江都电大  
http://down.jdtvu.net/
万福禅寺  
http://www.wanfusi.org/down/
犀鸟天地站  
http://www.hornbill.cdc.net.my/hbnews.htm
家园藏书   http://www.21manager.com/
计算机图书资料
http://www.vvsoft.net/vvbksd/index.asp
中国IT认证实验室-学习下载
http://download.chinaitlab.com/sort/2_1.htm
网络中国-E书
http://book.httpcn.com/

posted @ 2006-08-17 14:58 啤酒 阅读(337) | 评论 (0)编辑 收藏

仅列出标题
共2页: 1 2 

导航

统计

常用链接

留言簿(2)

随笔档案

收藏夹

搜索

最新评论

阅读排行榜

评论排行榜