Time of Update: 2017-01-10
標籤:exp blog oca ict ons str pre ups 時間格式 1 /// <summary> 2 /// 將datatable轉換為json
Time of Update: 2017-01-07
標籤:style lang 括弧 text sha c# lan ext http 本文所講內容,均可在《c#入門經典》中可以查詢。如有錯誤,敬請指出。謝謝!C#:全稱C
Time of Update: 2016-12-27
檔案流FileStream、StreamReader和StreamWriter可以操作大檔案;FileStream 操作位元組;可以操作任何類型的檔案;StreamReader和StreamWriter操作字元;FileStream方法名 作用 參數FileStream() 建立FileStream對象 第一個是路徑,第二個是檔案模式FIleMode枚舉,第三個資料模式FileAcess
Time of Update: 2016-12-27
var p = Process.GetProcessesByName("WINWORD"); if (p.Any()) { for (int i = 0; i < p.Length; i++) { p[i].Kill(); } } p =
Time of Update: 2016-12-27
#region 字串中多個連續空格轉為一個空格 /// <summary> /// 字串中多個連續空格轉為一個空格 /// </summary> ///<param name="str">待處理的字串 /// <returns>合并空格後的字串</returns> public static string MergeSpace(string str) {
Time of Update: 2016-12-27
#region 判斷遠程檔案是否存在 /// <summary> /// 判斷遠程檔案是否存在 /// </summary> ///<param name="fileUrl"> /// <returns></returns> public static bool RemoteFileExists(string fileUrl) {
Time of Update: 2017-01-10
Asp.Net分頁可以設定分頁的首頁、上一頁、下一頁、尾頁在前台顯示的連結文本。這裡只是提及簡易功能,深入研究剖析其原理就更得心應手了。//containerId 導航的目標容器,建議使用span標籤 //url 預設為XXX.XX?pagenum= //curPage 當前的頁碼 //maxSection 最大的分段數(一段裡面最大的頁數) //totalPage 總共的頁數 function
Time of Update: 2017-01-10
通常分頁有3種方法,分別是asp.net內建的資料顯示空間如GridView等內建的分頁,第三方分頁控制項如aspnetpager,預存程序分頁等。這裡分別做總結。 第一種:使用GridView內建分頁,這種是最簡單的分頁方法。 前台的方法: <asp:GridView ID="GridView1" AllowPaging="true" runat="server"
Time of Update: 2017-01-09
在System.Text.RegularExpression命名空間裡,有Regex方法。using System.Collections.Generic;using System.Text;using System.Text.RegularExpressions;namespace RegexDemo{ class Program { static void Main(string[] args) { Regex regex =
Time of Update: 2017-01-07
但是很多人都喜歡在 protected void Page_Load(object sender, EventArgs e) {}裡面來寫代碼,甚至在某些按鈕裡面寫判斷session是否存在~~ 這樣當然是能實現效果的,問題就在,如果有1000個頁面~~你需ctrl+C。。。Ctrl+V 很多次~~~ 我的思路就是寫一個BasePage類繼承 System.Web.UI.Page public class BasePage : System.Web.UI.Page {
Time of Update: 2017-01-03
接泛型二20.4 泛型委派聲明委託聲明可以包含型別參數。delegate-declaration: attributes opt delegate-modifiers op t delegate return-type identifier type-parameter-list opt(formal-parameter-list opt) type-parameter-constraints-clauses opt;(委託聲明: 特性可選 委託修飾符可選 delegate 傳回型別 標識符
Time of Update: 2016-12-30
[ASP.NETMVC 小牛之路]04 - 依賴注入(DI)和Ninject本文目錄:為什麼需要依賴注入在[ASP.NET MVC 小牛之路]系列的理解MVC模式文章中,我們提到MVC的一個重要特徵是關注點分離(separation of
Time of Update: 2016-12-30
ASP.NETMVC 小牛之路]01 -
Time of Update: 2016-12-29
protected void Button1_Click(object sender, EventArgs e) { string filename = this.DropDownList1.SelectedValue;//最終命名 if (this.FileUpload1.PostedFile != null) { string baseFilename = this.FileUpload1.PostedFile.FileName;//擷取上傳檔案檔案名稱 int i =
Time of Update: 2016-12-29
最近涉及到用asp.net做上傳功能的一個問題,因為asp.net有fileupload的上傳控制項,但是這個控制項上傳的檔案大小有限,所以根本滿足不了需求百度了下,很多人遇到asp.net上傳超大檔案的困惑,偶爾搜尋發現csdn有個哥們提到這個超大檔案如何?,RadUpload.Net2.dll並且提供了這個動態庫進行處理超大檔案的上傳處理過程。於是就下載下來看了看,果然效果不錯,不但支援吵過700M的檔案上傳快速,更重要的是支援多線程的上傳檔案。查看原始碼發現利用的控制項也是fileuplo
Time of Update: 2016-12-28
一、簡介:在過去的幾年中,NoSQL資料庫一度成為高並發、海量資料存放區解決方案的代名詞,與之相應的產品也呈現出雨後春筍般的生機。然而在眾多產品中能夠脫穎而出的卻屈指可數,如Redis、MongoDB、BerkeleyDB和CouchDB等。由於每種產品所擁有的特徵不同,因此它們的應用情境也存在著一定的差異,下面僅給出簡單的說明:1).
Time of Update: 2016-12-28
1、建立List用於存放多條語句/// <summary>/// 儲存表單/// </summary>/// <param name="context"></param>protected void save(){ List<string> list = new List<string>(); list.Add(string.Format("insert into
Time of Update: 2016-12-28
checked 關鍵字用於對整型算術運算和轉換顯式啟用溢出檢查。預設情況下,如果運算式僅包含常數值,且產生的值在目標類型範圍之外,則它會導致編譯器錯誤。 如果運算式包含一個或多個非常數值,則編譯器不檢測溢出。 在下面的樣本中,計算賦給 i2 的運算式不會導致編譯器錯誤。// The following example causes compiler error CS0220 because 2147483647 // is the maximum value for integers.
Time of Update: 2016-12-27
堆棧(Stack)代表了一個後進先出的對象集合。using System;using System.Collections; namespace CollectionsApplication{ class Program { static void Main(string[] args) { Stack st = new Stack(); st.Push('A');