Time of Update: 2018-12-07
產生: <?xml version="1.0" encoding="utf-8"?><CategoryList><Category ID="01"><MainCategory>XML</MainCategory><Description>This is a list my XML
Time of Update: 2018-12-07
擷取valueforeach (Student ss in stu.Values){ MessageBox.Show(ss.Name.ToString()); } ***********************************************擷取keyforeach (string key in stu.Keys) { MessageBox.Show(key);} }****************擷取key、valueforeach
Time of Update: 2018-12-07
private void ProjectInstaller_AfterInstall(object sender, InstallEventArgs e) { try { Process p = new Process(); p.StartInfo.FileName = "cmd.exe"; p.StartInfo.UseShellExecute =
Time of Update: 2018-12-07
public object DeCompress(string fileName) { object obj = null; try { using (Stream source = File.OpenRead(fileName)) { using (Stream destination = new
Time of Update: 2018-12-07
代碼Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
1:vc6中建立win32 簡單動態連結程式庫2:添加Rename.cpp檔案,如下: #include <string>#include <stdlib.h>using namespace std; extern "C" int _declspec(dllexport) renamefile(char *_oldname,char * _newname);int renamefile(char* _oldname,char* _newname) { char
Time of Update: 2018-12-07
可以通過調用kernel32.dll中的兩個api:WritePrivateProfileString,GetPrivateProfileString來實現對ini 檔案的讀些。具體實現的代碼如下:using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using System.Runtim
Time of Update: 2018-12-07
1、DateTime 數字型 System.DateTime currentTime=new System.DateTime(); 1.1 取當前年月日時分秒 currentTime=System.DateTime.Now; 1.2 取當前年 int 年=currentTime.Year; 1.3 取當前月 int 月=currentTime.Month; 1.4 取當前日 int 日=currentTime.Day; 1.5 取當前時 int 時=currentTime.Hour; 1.6
Time of Update: 2018-12-07
<TABLE class="tabcolor0" cellSpacing="1" cellPadding="3" width="98%" border="0"> <TR> <TD class="tabcolor2" style="WIDTH: 132px"> <DIV align="right">上傳檔案</DIV>
Time of Update: 2018-12-07
由於某方面的需要。需要使用到隨機數,所以查詢了這方面的資料。public int getFormatedNumeric(int min , int max){ int num = 0; Random ro = new Random(unchecked((int)DateTime.Now.Ticks)); num = ro.Next(min, max); return num;}CODE:[b]Random[/b]表示偽隨機數產生器,一種能夠
Time of Update: 2018-12-07
在利用C#搭建WAP平台的時候,開發變得很容易,使用者可以通過IE訪問,也可通過手機訪問,系統自動給出相應的html 代碼或者wml
Time of Update: 2018-12-07
除了點對點,通常UDP資料的傳遞方式有兩種,一種是BroadCast,一種是MultiCast。中文一般把它們翻譯作廣播和組播。前者是簡單的在區域網路裡面廣播;後者是藉助路由器將資料發送到包括英特網在內的任何多個地址。在C#裡面,處理UDP通訊最簡單的方法就是使用UdpClient。具體使用方法我也不贅述了,在msdn上就有。需要注意的問題有:1、UDP通訊在發送的時候可以綁定任何本地連接埠,但是在接收的時候需要在本地綁定廣播或者多播連接埠。2、組播的時候發送和接收雙方都需要JoinMultic
Time of Update: 2018-12-07
首先,自訂一個類ListViewNF,繼承自 System.Windows.Forms.ListView。代碼:using System;using System.Collections.Generic;using System.Text;using System.Windows.Forms;namespace ListViewDoubleTest{ class ListViewNF : System.Windows.Forms.ListView { public
Time of Update: 2018-12-07
public static DateTime BytesToDateTime(byte[] bytes, int offset) { if (bytes != null) { long ticks = BitConverter.ToInt64(bytes, offset); if (ticks < DateTime.MaxValue.Ticks
Time of Update: 2018-12-07
Microsoft Visual C++ 程式的部署由Microsoft Visual C++編譯的程式動態連結到C運行時(/MD 或 /MDd),它必須捆綁C運行DLL的一份拷貝(通常被叫作MSVCRT.DLL 或 MSVCRxx.DLL,其中xx代表Visual C++的版本)。1. 用Microsoft Visual C++ 6.0編譯的程式,或者發布在Windows 2000/NT/ME/98 系統單純通過拷貝MSVCRxx.DLL檔案到應用程式目錄或system32目錄即可2.
Time of Update: 2018-12-07
typedef LSTATUS(WINAPI *RegCreateKeyExWX)( __in HKEY hKey, __in LPCWSTR lpSubKey, __reserved DWORD Reserved, __in_opt LPWSTR lpClass, __in DWORD dwOptions, __in REGSAM samDesired, __in_opt CONST LPSECURITY_ATTRIBUTES
Time of Update: 2018-12-07
假設我們的特徵碼定位在MessageBoxA函數的地址(只是舉個例子,一般這個函數不會被殺,其他函數也類似方法)那麼我們到源碼裡面發現,我們在PrintMsg函數中調用了這個API函數,那麼我們就要對他進行處理。對於輸入表被查殺我們一般的處理方法是修改函數的調用方式,比如採用dll動態調用,通過,我們知道我們是以非unicode方式編譯的MessageBox,他對應的非Unicode的函數為MessageBoxA,同時我們也得到這個MessageBoxA函數在UER32.dll檔案中。那麼我們修
Time of Update: 2018-12-07
using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;using System.IO;using System.Data.SqlClient;namespace WinApp{ public class Sequence { [DllImport("kernel32.dll")] public static
Time of Update: 2018-12-07
在C#的winform程式中我們如果要開啟網頁的話我們常用的是System.Diagnostics.Process.Start("IEXPLORE.EXE",http://www.lanmeng.org/);或WebBrowser Web_New=New WebBrowser();Web_New.Navigate("http://www.lanmeng.org");但是這個我們只能用ie開啟網頁,但是我們不希望這樣
Time of Update: 2018-12-07
HttpContext.Current.Request.ServerVariables Request.ServerVariables["Url"] 返回伺服器位址Value 0: /WebSite1/Default.aspxRequest.ServerVariables["Path_Info"] 用戶端提供的路徑資訊Value 0: /WebSite1/Default.aspxRequest.ServerVariables["Appl_Physical_Path"]