原创 C#使用攝像頭拍照

using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms;

原创 自己寫的數據訪問層(使用ini文件加密存儲sql數據庫登陸信息)

數據訪問類: using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using Syste

原创 天氣挺好,心情不錯

今天天氣挺好,心情不錯。想寫些東西,又想不起要寫什麼。引句李白的詩:仰天大笑出門去,我輩豈是蓬蒿人

原创 c#導出數據到Excel

1、filename是導出的文件名 //導出數據到Excel表    public void ExportExcel(DataSet my_Ds, string filename)    {        //DataSet ds = t

原创 Docker 學習

一 Hello Docker #拉取busybox官方鏡像,啓動容器並執行輸出"Hello Docker" #********** Begin *********# docker pull busybox:latest docker

原创 DataTable IList<T> 與 Json 互轉

DataTable IList 與 Json 互轉  #region Json轉DataTable         public static DataTable Json2Dtb(string json)         {      

原创 Nhibernate 數據操作封裝類 可以執行hql 原生sql 返回DataSet

public class SessionManager { # region 當前單實例 private readonly static SessionManager instance = new

原创 asp.net調用jqueryajax

<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" cont

原创 編譯自己的資源文件編輯器(reseditor.exe)

VS.net2003本身帶了一個資源文件編輯軟件,但默認沒有編繹,不能使用。下面是我編繹這個工具的過程: http://www.mscto.com 1.找到reseditor這個目錄。一般在“ ProgramFiles\Microso

原创 用C#製作PDF文件全攻略(轉)

  用C#製作PDF文件全攻略(轉) StreamWriter pPDF=new StreamWriter(filePath); ArrayList xRefs=new ArrayList(); f

原创 asp.net 新聞發佈多附件上傳

使用 input file 實現多附件上傳,注意form中必須添加 enctype="multipart/form-data"  method="post" <form id="form1" runat="server" enctyp

原创 asp.net中Session概述

Session又稱爲會話狀態,是Web系統中最常用的狀態,用於維護和當前瀏覽器實例相關的一些信息。舉個例子來說,我們可以把已登錄用戶的用戶名放在Session中,這樣就能通過判斷Session中的某個Key來判斷用戶是否登錄,如果登錄的話

原创 解決網頁 刷新 提交 和後退的問題

Response.Write("<script>alert('投票成功,感謝您的參與!');location.href='" + Request.Url.ToString() + "';</script>"

原创 資源文件使用總結一

//在這裏,我來總結一下關於資源文件的相關操作。 //1.比較常見的有獲取資源文件對應的文件流,然後轉換到相對應的文件 //比較典型的做法是通過代碼程序集加載指定資源 //如下通過Assembly的靜態方法GetExecutingAsse

原创 asp.net關閉瀏覽器後強制用戶離線

asp.net用戶登錄後,狀態更新爲在線,在點擊程序中退出按鈕後自動離線,並記錄到日誌表中。但是如果強制關閉瀏覽器,就無法記錄。 後來想通過心跳包的方式,在正常登錄並在線時每隔一分鐘刷新一次登錄狀態,後臺