目前分類:asp.net C# (19)
- Jun 21 Thu 2018 00:00
C# 判斷是否英文字母或數字的正則表達式
- Nov 01 Wed 2017 00:00
C# 找不到包含 OwinStartupAttribute 的程序集
webconfig
<appSettings>
<add key="owin:AutomaticAppStartup" value="false" />
</appSettings>
- Jul 05 Thu 2012 10:08
C# 撥放音樂Media.SoundPlayer
System.Media.SoundPlayer player = new System.Media.SoundPlayer();
string path =@"D:\";
foreach (var code in voicecode)
{
- Jun 13 Wed 2012 21:16
C# send Email
MailMessage message = new MailMessage();
message.From = new MailAddress("xxx@gmail.com");//寄件人
message.To.Add("xxx@yahoo.com.tw");//收件人
message.SubjectEncoding = Encoding.UTF8;//標題編碼
- May 20 Sun 2012 01:40
C# 上傳照片限制
- Jan 04 Wed 2012 15:11
C# NPOI HSSFRichTextString
public HSSFRichTextString IsNatural_Number(HSSFWorkbook workbook, string str)
{
HSSFRichTextString richtext = new HSSFRichTextString(str);
HSSFFont font = (HSSFFont)workbook.CreateFont();
- Nov 03 Thu 2011 12:10
C# itextsharp 儲存格格式-取小數點
//對小數點處理
public string pointstyle(string num, int point)
{
string pointNum = num;
- Nov 03 Thu 2011 12:08
C# NPOI 設定儲存格格式
顯示有逗號區分的數值資料
HSSFCellStyle styleNumeric = (HSSFCellStyle)workbook.CreateCellStyle();
HSSFDataFormat format = (HSSFDataFormat)workbook.CreateDataFormat();
styleNumeric.DataFormat =format.GetFormat("###,##0");
- Nov 02 Wed 2011 15:44
C# iTextSharp 頁碼
- Oct 14 Fri 2011 13:35
C# Itextsharp PDF
Itextsharp PDF
//匯出檔案可以選擇另存OR開啟舊檔
- Aug 12 Fri 2011 09:59
C# 轉XML特殊字元
public string XMLEncode(string str)
{
str = str.Trim();
- Mar 31 Thu 2011 10:58
C# 刪除目錄底下檔案
using System.IO;
string NewFilePath = (System.Web.HttpContext.Current.Request.PhysicalApplicationPath + "\\Output\\" + CoIdFileName + YrId + SsId + "\\").Replace("/", "\\");
string[] files = Directory.GetFiles(NewFilePath, "*.xls");//找出目錄底下檔案
- Mar 29 Tue 2011 14:35
C# 不下載自動存檔
- Mar 28 Mon 2011 13:17
C# NPOI
using NPOI;
using NPOI.HSSF;
using NPOI.HSSF.UserModel;
using NPOI.POIFS;
- Mar 28 Mon 2011 13:14
C# 讀下層資料夾
using System.IO;
//路徑
foreach (string fname in System.IO.Directory.GetFileSystemEntries("c:\\windows"))
{
- Mar 28 Mon 2011 13:09
C# 壓縮檔案ZIP
using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Zip.Compression;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;