Time of Update: 2018-12-07
1.dll 項目// Dll1.cpp : 定義 DLL 應用程式的進入點。//#include "stdafx.h"extern "C"_declspec(dllexport)void maopao(int *p,int count);void maopao(int *p,int count){ int temp=0; for(int i=1;i<count;i++) { for(int j=count-1;j>=i;j--) {
Time of Update: 2018-12-07
PropertyInfo[] objTempArr; BindingFlags objFlag = (BindingFlags.Public | BindingFlags.Instance); try { objTempArr = this.GetType().GetProperties(objFlag); for (int i = 0; i <
Time of Update: 2018-12-07
public class EnumUtil { /// <summary> /// convert obj to Enum /// </summary> /// <typeparam name="T"></typeparam> /// <param name="obj"></param> ///
Time of Update: 2018-12-07
在將各種類型的資料構造成字串時,sprintf 的強大功能很少會讓你失望。由於sprintf 跟printf 在用法上幾乎一樣,只是列印的目的地不同而已,前者列印到字串中,後者則直接在命令列上輸出。這也導致sprintf 比printf 有用得多。 sprintf 是個變參函數,定義如下: int sprintf( char *buffer, const char *format [, argument] ... );
Time of Update: 2018-12-07
使用c#編寫一個winform程式, 管理一個windows服務。對指定的windows服務,進行啟動、停止、重新啟動1、引入 using System.ServiceProcess;2、 /// <summary> /// 重新啟動按鈕 /// </summary> /// <param name="sender"></param> /// <param
Time of Update: 2018-12-07
C# 前台代碼<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default25.aspx.cs" Inherits="Default25" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Time of Update: 2018-12-07
淺拷貝和深拷貝有兩種對象複製的方法:淺拷貝和深拷貝。淺拷貝只是複製引用,而不會複製引用的對象。深拷貝會複製引用的對象。因此,原始對象中的引用和淺拷貝對象中的同一個引用都指向同一個對象。而深拷貝的對象包含了對象的一切直接或間接的引用。參看維基百科(http://en.wikipedia.org/wiki/Object_copy)來獲得更多解釋。ICloneable介面ICloneable介面包含一個Clone方法,可以用來建立當前對象的拷貝。public interface ICloneable
Time of Update: 2018-12-07
/// <summary> /// 截取字串 /// </summary> /// <param name="inputString">原始字串</param> /// <param name="length">截取長度</param> /// <returns>截取後的字串</returns> public static string SubString(string
Time of Update: 2018-12-07
代碼Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Time of Update: 2018-12-07
在C#中可以使用Regex來過濾html字元,比如,在驗證使用者輸入時,為了保證安全性,就需要過濾html字元。using System.Text.RegularExpressions;Regex.Replace(htmlcode ,"<[^>]+>","");解釋一下:< 代表以 "< "開頭[^>] 其中[^...] 就是匹配任何字元,但不許匹配^之後緊跟的字元,也就是如果"<>"
Time of Update: 2018-12-07
這裡我舉例一些c#中常用的spli的幾種方式1、用字串分隔: using System.Text.RegularExpressions;string str="aaajsbbbjsccc";string[] sArray=Regex.Split(str,"js",RegexOptions.IgnoreCase);foreach (string i in sArray) Response.Write(i.ToString() + "<br>");輸出結果:aaabbbccc2、用多個字
Time of Update: 2018-12-07
問題描述:ExtJs的EditorGridPanel 批量修改、一次性儲存。 1. save.js ---------------------------------------var Json = ""; //傳入背景json字串var flag = false; //是否添加逗號標誌var grid = new Ext.grid.EditorGridPanel({ clickstoEdit : 1, listeners : {
Time of Update: 2018-12-07
public class baseclass{ public bool sendemail(string toadd, string sb, string subject)//toadd:目的地址 ,sb:內容 ,subject主題 { try { MailAddress from = new MailAddress("sweting@163.com");//用於發送郵件的地址。 MailAddress
Time of Update: 2018-12-07
驗證碼/*using System.Drawing;using System.Drawing.Drawing2D;using System.Drawing.Imaging;using System.Drawing.Text;*/ //建立位元影像對象 Bitmap newBitmap = new Bitmap(36, 16, PixelFormat.Format32bppArgb); //根據上面建立的位元影像對象建立繪圖面
Time of Update: 2018-12-07
以下適用於 As3,C#,Js,Java 等大部分基於ECMA標準的語言 //邏輯編程部分 1。 uint,int,number,float 等數字類型中,int速度最快,而不是一般人認為的uint. 2。 集合對象 Array,Object,自訂類 中, 速度是 自訂類 > object > Array 3。 移位元運算可以大幅提高數學計算的效率 (我提交的時候QQ說我這句有非法字元。。) 例:大約快了300% x = x * 2; x = x * 64; //相當於: x =
Time of Update: 2018-12-07
ASP.net 1.1 smtp發郵件Sent email by System.Web.Mail.MailMessage in c#-handiz@hotmail.com ----------------------------------------------------- public void SendMail(string recp, string title, string msg) {
Time of Update: 2018-12-07
2007-03-23 08:42簡介序列化是指將對象執行個體的狀態儲存到儲存媒體的過程。在此過程中,先將對象的公用欄位和私人欄位以及類的名稱(包括類所在的程式集)轉換為位元組流,然後再把位元組流寫入資料流。在隨後對對象進行還原序列化時,將建立出與原對象完全相同的副本。在物件導向的環境中實現序列化機制時,必須在易用性和靈活性之間進行一些權衡。只要您對此過程有足夠的控制能力,就可以使該過程在很大程度上自動進行。例如,簡單的二進位序列化不能滿足需要,或者,由於特定原因需要確定類中那些欄位需要序列化。
Time of Update: 2018-12-07
1. 這個是不調用IE Mailto 來發送的,調用win API來Mailto.ShellExecute(0, String.Empty, "mailto:vcool011@hotmail.com?subject=這是標題哦&body=這是常值內容啊!!!!!!!!! C:\\avatar.xml", String.Empty, String.Empty, 1);class Mailto //與我聯絡開啟郵箱的類 {
Time of Update: 2018-12-07
using System;using System.Collections.Generic;using System.Text;using System.IO;using Microsoft.Win32;using System.Diagnostics;namespace Uni.UniCustoms{ public class clsWinrar { /// <summary> /// 是否安裝了Winrar /// </
Time of Update: 2018-12-07
一、取某月的最後一天一、取某月的最後一天法一、使用算出該月多少天,年+月+加上多少天即得,舉例取今天這個月的最後一天private void GetLastDateForMonth(DateTime DtStart,out DateTime DtEnd) { int Dtyear,DtMonth; DtStart = DateTime.Now; Dtyear = DtStart.Year; DtMonth = DtStart.Month; int MonthCount =