C# 的 DES 加密和解密方法

1 /// <summary> 2 /// 進行DES加密。 3 /// </summary> 4 /// <param name="pToEncrypt">要加密的字串。</param> 5 /// <param name="sKey">密鑰,且必須為8位。</param> 6 /// <returns>以Base64格式返回的加密字串。</returns> 7 public string

C#修改檔案屬性

1 string path = @"c:\temp\MyTest.txt"; 2 // Delete the file if it exists. 3 if(!File.Exists(path)) 4 { 5 File.Create(path); 6 } 7

C#.NET 支援檔案拖放

 建立文字框txtSrcFname,設計其AllowDrop為true,處理DragEnter、DragDrop 事件。 1 private void txtSrcFname_DragEnter(object sender, DragEventArgs e) 2 { 3 if (e.Data.GetDataPresent(DataFormats.FileDrop)) 4 e.Effect = DragDropEffects.All; 5 else 6

C#打造快速的連接埠掃描器

實現windows表單版)  實現控制台版)  連接埠掃描器大家都不陌生吧,用著別人的連接埠掃描器,雖說方便,但是如果能夠做一個,當然是一個賞心悅目的事。其實,實現自己的連接埠掃描器並不困難。而且原理也比較簡單,只要我們具備基礎的網路知識,明白tcp三向交握原則即可。  C#提供一組網路編程的類,使網路編程更加簡單優美。其中,Socket封裝了大多數用於網路通訊的api,要實現連接埠掃描,我們只需使用Socket.Connect()方法。然後再判斷Socket.Connected是否為真,如果為

c#中文漢字首字母自動產生代碼

1 //取漢字首字母 2 private string GetChineseSpell(string strText) 3 { 4 int len = strText.Length; 5 string myStr = ""; 6 for (int i = 0; i < len; i++) 7 { 8 myStr +=

C語言指標5分鐘教程

文章目錄 轉自:http://www.admin10000.com/document/998.html指標、引用和取值void指標、NULL指標和未初始化指標指標和數組指標與結構體總結

C#二分找

1 public static int BinSort(int[] array,int key) 2 { 3 int low = 0; 4 int high = array.Length - 1; 5 int mid = 0; 6 int n = 0; 7 while (low <= high) 8 { 9 n++;10 mid = (low + high) / 2;11

C# TextBox智能提示

1 private void Form1_Load(object sender, EventArgs e) 2 { 3 AutoCompleteStringCollection strings = new AutoCompleteStringCollection(); 4 strings.Add("A1");//不區分大小寫 5 strings.Add("A2"); 6 strings.Add("Aas"); 7

C#.NET 實現程式自動更新

1 public static string RemoteVersion(string url) 2 { 3 string rv = ""; 4 5 System.Net.HttpWebRequest req = (System.Net.HttpWebRequest) 6 System.Net.WebRequest.Create(url); 7 System.Net.HttpWebResponse response =

C#擷取作業系統資訊

Windows作業系統的版本號碼一覽 作業系統PlatformID主要版本號副版本號碼Windows95140Windows981410WindowsMe1490WindowsNT3.5230WindowsNT4.0240Windows2000250WindowsXP251Windows2003252WindowsVista260Windows7261Windows8    擷取作業系統資訊的相關類或屬性//擷取系統資訊System.OperatingSystem osInfo =

C#改變檔案屬性

1 string path = @"c:\temp\MyTest.txt"; 2 // check file. 3 if(!File.Exists(path)) 4 { 5 File.Create(path); 6 } 7 if((File.GetAttributes(path)&FileAttributes.Hidden)==FileAttributes.Hidden) 8 { 9

C#表單漸層實現

1 //開啟程式後,表單由透明到不透明逐漸顯示出來。 2 //實現方法: 3 1. 添加一個Timer控制項(此例中命名為:fadeTimer),然後在其Tick事件中添加FadeTimer_Tick中的相關代碼即可,簡單吧,呵呵。 4 在該表單類的建構函式裡面添加如下代碼: 5 private bool showing = true; 6 public LoginForm() 7 { 8 InitializeComponent(); 9 10 //表單顯示特效11 Opacity = 0.0;

C# 擷取可行動裝置盤符

1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Windows.Forms; 9 using JaveSystem;10 using System.Management;11

C#.NET實現檔案夾的複製

1 只提供了檔案的Copy方法,但卻沒有提供檔案夾的Copy方法,經過一天的努力,終於搞定。現貼出主要代碼供大家參考,歡迎大家提出建議。代碼如下: public int DirectoryName(string DirectoryPath)//擷取檔案夾名,截取“\” 2   { 3   int j = 0; char[] c = DirectoryPath.ToCharArray(); 4   for (int i = c.Length - 1; i >= 0;

C#調用cmd執行

1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading; 6 using System.Diagnostics; 7 8 namespace ConsoleApplication1 9 {10 class command11 {12 public static string

c# List實現隨機排序

using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace RandomDemo{    class Program    {        static void Main(string[] args)        {            List<Student> oItem = new List<Student>();           

Unity3D中C#和JS的方法互相調用

      由於Unity3D中一些腳本的方法只能用在JS中,在C#中是無效的,而C#可以與服務器端通訊,JS本身卻不行。所以勢必會遇到這兩種語言腳本中方法的互相調用,以下是樣本。兩個檔案 test1.js 和 test2.cstest1.jsCode highlighting produced by Actipro CodeHighlighter

[轉載]C#開源項目(國外的還是很多)

C#開源項目(國外的還是很多)一、Ajax架構Ajax.NET Professional

C# 中的實值型別和參考型別

C# 中所有的資料類型不是實值型別就是參考型別。本文就這兩種類型在變數定義、賦值、和作為函數參數傳遞時的不同之外作簡單討論。實值型別是使用對象實際值來表示對象的資料類型。 如果向一個變數分配實值型別的執行個體,則該變數將被賦以該值的全新副本。 參考型別是使用對對象實際值的引用(類似於指標)來表示對象的資料類型。 如果為某個變數分配一個參考型別,則該變數將引用(或指向)原始值。 不建立任何副本。(來自MSDN)實值型別包括:所有的數實值型別 Boolean、Char 和 DateTime

C# 3.0 新特性—-擴充方法

轉自 http://www.cnblogs.com/jiejie_peng/archive/2010/04/08/1707195.htmlC# 3.0 新特性----擴充方法主要目的掌握對一個已經編譯的類的方法的擴充特別注意a. 擴充某個類時,建立的類要使用 public static 修飾,因為預設的類是 internal 存取修飾詞b. 這個類要有檔案範圍,即不能作為嵌套類使用c. 擴充方法要聲明為靜態d. 擴充方法的第一個參數類型即是要擴充的類,且該參數前要加 this 關鍵字e.

總頁數: 4314 1 .... 812 813 814 815 816 .... 4314 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.