Time of Update: 2017-02-28
資料|資料庫 本文將涉及到在.net架構下使用C#語言操縱資料庫事務的各個方面。 體驗SQL語言的事務機制作為大型的企業級資料庫,SQL Server2000對事務提供了很好的支援。我們可以使用SQL語句來定義、提交以及復原一個事務。如下所示的SQL代碼定義了一個事務,並且命名為"MyTransaction"(限於篇幅,本文並不討論如何編寫SQL語言程式,請讀者自行參考相關書籍):DECLARE @TranName
Time of Update: 2017-02-28
資料|資料庫 什麼是資料庫事務 資料庫事務是指作為單個邏輯工作單元執行的一系列操作。 設想網上購物的一次交易,其付款過程至少包括以下幾步資料庫操作: · 更新客戶所購商品的庫存資訊 · 儲存客戶付款資訊--可能包括與銀行系統的互動 · 產生訂單並且儲存到資料庫中 · 更新使用者相關資訊,例如購物數量等等
Time of Update: 2017-02-28
visual 使用 System.IO 和 Visual C# .NET 讀取文字檔在 Visual C# .NET 中讀取文字檔 開啟和讀取檔案進行讀取存取是輸入/輸出 (IO) 功能的一個非常重要的部分,即使您不需要寫入到相關檔案,也是如此。 本樣本開啟一個檔案進行讀取,這適用於讀取文字檔,但不適用於讀取二進位檔案。 本樣本使用多個可用於開啟檔案的方法之一。 雖然很多資料結構都可以用於儲存從檔案中檢索到的資訊,但是,arraylist
Time of Update: 2017-02-28
本通訊程式沒有服務端和用戶端之分,區域網路的電腦運行同一程式即可通訊。由於水平有限,目前版本還很菜,只可以實現基本的聊天功能和顯示線上使用者功能。準備添加傳送檔案、聊天日誌、選擇性參數等功能。 using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using
Time of Update: 2017-02-28
資料|資料庫|轉換 /*a、注意資料庫編碼要能相容gb2312和big5,比如MySql中使用utf8b、該代碼採用遍曆的方式,並用MySqlCommandBuilder進行批次更新,所以能轉換的表必須包含主鍵,不包括主鍵的表則不能轉換c、引用了Microsoft.VisualBasic.dll進行簡繁轉換*/using System;using System.Data;using MySql.Data;using
Time of Update: 2017-02-28
using System;using System.Drawing;using System.Windows.Forms;public class Form4 : Form{ private TreeView treeView1; public Form4() { treeView1 = new TreeView(); this.SuspendLayout(); // Initialize
Time of Update: 2017-02-28
程式|執行 1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName 擷取模組的完整路徑。2. System.Environment.CurrentDirectory
Time of Update: 2017-02-28
//讀取INI檔案;private string GetPrivateProfileString(string ApplicationName, string KeyName,string Default, string FileName){string[] iniItems = new string[0]; string iniLines; string iniLine; int i, j; try{//讀取INI檔案;System.IO.StreamReader iniFile = new
Time of Update: 2017-02-28
函數|中文 ///str_value 字元///str_len 要截取的字元長度 public string leftx(string str_value,int str_len) { int p_num = 0; int i; string
Time of Update: 2017-02-28
/* Copyright (C) 1999 Aladdin Enterprises. All rights reserved. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any
Time of Update: 2017-02-28
建立
Time of Update: 2017-02-28
編程|瀏覽器 聲明:本文已經放到了天極網站上,這裡只是收藏而已。未經許可,不得轉載IE是現在Windows平台下用的最多的瀏覽器,那麼如何用程式來修改IE,打造有自己的特色的IE呢?我在這裡向介紹怎麼C#用通過註冊表來修改IE。首先我們來熟悉一下C#中修改註冊表的方法與函數。在VC#中提供了Registry類、RegistryKey類來實現對註冊表的操作。其中Registry類封裝了註冊表的七個基本主健:Registry.ClassesRoot
Time of Update: 2017-02-28
教程|控制|迴圈|語句 本節課將介紹如何使用C#控制語句中的迴圈語句,本課目的如下:1.學會"while"迴圈的用法。2.學會"do" 迴圈的用法。3.學會"for"
Time of Update: 2017-02-28
visual|編程|資料|資料庫 在Visual Studio.NET Beta 1版本中訪問IBM DB2等非SQL Server資料庫通常是使用ADO.NET的ODBC方法,而在Beta 2中則改用OLE DB方式存取資料庫。 Beta1中連接字串主要需聲明資料庫的ODBC的DNS名字,但Beta 2中的OLE
Time of Update: 2017-02-28
visual|資料 在本篇文章中,我們將介紹Visual C#對資料庫的一個基本操作,即:如何往資料庫中添加記錄。我們將通過一些資料庫操作的例子,來具體說明一下。為了更清楚的說明這個問題,在選用資料庫方面採用了二種當前比較典型的資料庫,其一是本機資料庫--Access 2000,另外一個是遠端資料庫--SQL SERVER 7.0。首先介紹如何用Visual C#來添加Access 2000資料庫的記錄。一.用Visual
Time of Update: 2017-02-28
教程|控制|語句
Time of Update: 2017-02-28
An indexer enables you to use an index on an object to obtain values stored within the object. In essence this enables you to treat an object like an array.An indexer is also similar to a property. As with properties, you use get and set when
Time of Update: 2017-02-28
教程 SUNWEN教程之----C#進階(二)mrfat@china.com 好了,I COME BACK,下面的代碼顯示了我們如何列印多個參數:000: // CommandLine\cmdline1.cs001: using System;002:003: public class CommandLine004: {005: public static void
Time of Update: 2017-02-28
教程
Time of Update: 2017-02-28
web 下面,我們看看如何建立和部署一個最簡單的Web服務 建立Web服務1.在wwwroot目錄下建立一個叫做Webservice的目錄。2.建立下面這樣一個檔案:<%@ WebService Language="c#" Class="AddNumbers"%>using System;using System.Web.Services;public class AddNumbers :