可以用DSA和RSA,如: using System; using System.Text; using System.Security.Cryptography; class dsacrypto_SignData { public static void Main(String[] args){ //先要將字串轉換為位元組數組,這與編碼有關。 String str = "this is a test."; byte[] bytes = Encoding.ASCII.GetBytes(str);
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Net; using System.Threading; namespace WindowLanSearch { /// <summary> /// Form1 的摘要說明。 /// &
作者:Sabine 【導讀】本文介紹了C#的四種排序演算法:冒泡排序、選擇排序、插入排序和希爾排序 冒泡排序 using System; namespace BubbleSorter { public class BubbleSorter { public void Sort(int [] list) { int i,j,temp; bool done=false; j=1; while((j<list.Length)&&(!done)) {
using System; using System.Runtime.InteropServices; using System.Management; namespace Hardware { /// <summary> /// Hardware_Mac 的摘要說明。 /// </summary> public class HardwareInfo { //取機器名 public string GetHostName() { return
using System; using System.DirectoryServices; using System.Collections; using System.Text.RegularExpressions; using System.Text; /** * @author 吳海燕 * @email wuhy80-usual@yahoo.com * 2004-6-25 第一版 */ namespace Wuhy.ToolBox { ///
首先,我們先看幾個實際的例子: 1. 驗證輸入字元是否javascript: var ex = "^\\w+$"; var re = new RegExp(ex,"i"); return re.test(str); VBScript Dim regEx,flag,ex ex = "^\w+$" Set regEx = New RegExp regEx.IgnoreCase = True regEx.Global = True regEx.Pattern = ex