Time of Update: 2018-12-07
private void CreateCheckCodeImage(string checkCode) { if(checkCode == null || checkCode.Trim() == String.Empty) return; System.Drawing.Bitmap image = new System.Drawing.Bitmap((int)Math.Ceiling((checkCode.Length * 12.5)), 22); Graphics g =
Time of Update: 2018-12-07
public string GetPost(string url, params string[] data) { string tempMessage = ""; System.Net.WebClient WebClientObj = new System.Net.WebClient(); System.Collections.Specialized.NameValueCollection PostVars =
Time of Update: 2018-12-07
public static string StructSql(int startYear, int startMonth, int endYear, int endMonth) { StringBuilder tempSql = new StringBuilder(); DateTime dtStart = new DateTime(startYear, startMonth, 1); DateTime dtEnd
Time of Update: 2018-12-07
[ControlBuilder(typeof(TextBoxControlBuilder)), DefaultProperty("Text"), ParseChildren(false), DataBindingHandler("System.Web.UI.Design.TextDataBindingHandler, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"),
Time of Update: 2018-12-07
[assembly: TagPrefix("WebPages", "WebPages")] //XXX為自訂控制項的名稱空間,YYY為你所想要得名字using System;using System.Collections.Generic;using System.ComponentModel;using System.Text;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.
Time of Update: 2018-12-07
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Threading;using System;using System.Threading;namespace DataImportFromAccess{
Time of Update: 2018-12-07
public class ConfigOperator { public string strFileName; public string configName; public string configValue; public ConfigOperator() { // // TODO: 在此處添加建構函式邏輯 // } public string ReadConfig1(string configKey) { configValue = ""; configValue =
Time of Update: 2018-12-07
public void MakeSmallPic(string oldfile, string newfile,int width,int height) { System.Drawing.Image image = System.Drawing.Image.FromFile(oldfile); //擷取原圖高度和寬度 int oldh = image.Height; int
Time of Update: 2018-12-07
public void RARsave(string rarPatch, string rarFiles,string patch,string rarName) { String the_rar; RegistryKey the_Reg; Object the_Obj; String the_Info; ProcessStartInfo
Time of Update: 2018-12-07
public void RARsave(string rarPatch, string rarFiles,string patch,string rarName) { String the_rar; RegistryKey the_Reg; Object the_Obj; String the_Info; ProcessStartInfo the_StartInfo;
Time of Update: 2018-12-07
public string ReadFile(string path) { string tempContent = ""; using (StreamReader sr = new StreamReader(path,System.Text.Encoding.GetEncoding("gb2312"))) { tempContent = sr.ReadToEnd();
Time of Update: 2018-12-07
原因:可能是鍵盤的 2,衝擊波的問題3,dll 註冊掉了方法一:重新註冊以下DLL檔案。 regsvr32 Shdocvw.dll regsvr32 Shell32.dll (注意這個命令,先不用輸) regsvr32 Oleaut32.dll regsvr32 Actxprxy.dll regsvr32 Mshtml.dll regsvr32 Urlmon.dll 第二個命令可以先不用輸,輸完這些命令後重新啟動windows,如果發現無效,再重新輸入一遍,這次輸入第二個命令。
Time of Update: 2018-12-07
public static void ExportToExcel(DataTable dt, string fileName) { //在做這些前,將Excl添加到引用中來!! Excel.Application excel = new Excel.Application(); //如果系統是Excl2007,添加的引用會不一樣,代碼如下。
Time of Update: 2018-12-07
using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;using System.Diagnostics;using System.Management;namespace sendkey{public class key{const uint PROCESS_ALL_ACCESS = 0x001F0FFF;const uint
Time of Update: 2018-12-07
C# 去所有 html標籤的代碼|去除html標籤代碼 public string NoHTML(string Htmlstring) //去除HTML標記 { //刪除指令碼 Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "", RegexOptions.IgnoreCase); //刪除HTML
Time of Update: 2018-12-07
使用net use 命令實現遠程機器的檔案複製。比如,從機器A操作實現把機器B的檔案拷貝到機器A上,需要把機器B檔案夾加上機器A的使用者權限。public static bool Ping(string remoteHost) { bool Flag = false; Process proc = new Process(); try { proc.StartInfo.FileName =
Time of Update: 2018-12-07
private void button1_Click(object sender, System.EventArgs e){object oMissing = System.Reflection.Missing.Value;object oEndOfDoc = "\\endofdoc"; /* \endofdoc是預定義的bookmark */ //建立一個document.Word._Application oWord;Word._Document oDoc;oWord = new Word.
Time of Update: 2018-12-07
索引器就是特殊的屬性,以下是最簡單的索引器例子就是給定索引編號去找索引編號對應的值,類似屬性的數組 public string this[string configName] { get { return System.Configuration.ConfigurationManager.AppSettings[configName]; }
Time of Update: 2018-12-07
public string getSpell(string cn) { string tempChar = ""; char[] temp = cn.ToCharArray(); for (int j = 0; j < temp.Length; j++) { byte[] arrCN =
Time of Update: 2018-12-07
//Response.Expires = 0; //Response.Buffer = true; //Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1); //Response.AddHeader("pragma", "no-cache"); //Response.CacheControl = "no-cache";c#的實現方法