PIXNET Logo登入

夏天的雙重性格

跳到主文

雙重性格的夏天

部落格全站分類:生活綜合

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 3月 18 週四 201014:24
  • C# 上傳文件至FTP

 FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://帳號@ftp.XXXX.com.tw/ExcelFile.xls");
            request.Method = WebRequestMethods.Ftp.UploadFile;
            // FTP的帳密.
            request.Credentials = new NetworkCredential("帳號", "密碼");
            // 要上傳的檔案
            StreamReader sourceStream = new StreamReader("ExcelFile.xls");
            byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
            sourceStream.Close();
            request.ContentLength = fileContents.Length;
            Stream requestStream = request.GetRequestStream();
            requestStream.Write(fileContents, 0, fileContents.Length);
            requestStream.Close();
            FtpWebResponse response = (FtpWebResponse)request.GetResponse();
            Console.WriteLine("Upload File Complete, status {0}", response.StatusDescription);
            response.Close();
(繼續閱讀...)
文章標籤

pdyurfof 發表在 痞客邦 留言(0) 人氣(11,824)

  • 個人分類:程式
▲top
  • 2月 22 週一 201013:38
  • SQL server 更改欄位為自動編號

--刪除主鍵
ALTER TABLE [dbo].[cuspayrec]  DROP CONSTRAINT [PK_CuspayRec]
GO
--刪除cp_id欄位
alter   table   [dbo].[cuspayrec]   drop   column   cp_id  
Go
(繼續閱讀...)
文章標籤

pdyurfof 發表在 痞客邦 留言(0) 人氣(14,121)

  • 個人分類:程式
▲top
  • 11月 16 週一 200910:29
  • VB 在DataGridView中加入按鈕欄位

宣告
        Dim NewColumn As New DataGridViewButtonColumn
名稱="button"      
        NewColumn.Name = "button"
DGV新增Column
(繼續閱讀...)
文章標籤

pdyurfof 發表在 痞客邦 留言(0) 人氣(3,861)

  • 個人分類:程式
▲top
  • 10月 21 週三 200910:24
  • C# 復製DataGridView至另一個DataGridView

'假設dt1已有資料,宣告新的dt2
Dim dt2 As DataTable
'復製dt1的結構
dt2 = dt1.Clone
(繼續閱讀...)
文章標籤

pdyurfof 發表在 痞客邦 留言(0) 人氣(209)

  • 個人分類:程式
▲top
  • 10月 08 週四 200910:20
  • C# isDate and isNumber 函式

public static bool IsNumeric(string anyString)
{
if (anyString == null)
{
anyString = "";
}
if (anyString.Length > 0)
{
double dummyOut = new double();
System.Globalization.CultureInfo cultureInfo =
new System.Globalization.CultureInfo("en-US", true);
return Double.TryParse(anyString, System.Globalization.NumberStyles.Any,
cultureInfo.NumberFormat, out dummyOut);
}
else
{
return false;
}
}
(繼續閱讀...)
文章標籤

pdyurfof 發表在 痞客邦 留言(1) 人氣(2,298)

  • 個人分類:程式
▲top
  • 9月 17 週四 200911:59
  • Access查詢 統計 每天金額與每天每個類別金額

現在有一個資料表,欄位有日期、件數、金額、類型等等
類型有A、B、C三種
我想要依每天做統計,
所以語法是select count(*),sum(件數),sum(金額) from table gruop by 日期
但是我想加上欄位是每一天類型為A、B、C的金額
count(*),sum(件數),sum(A類的金額),sum(B類的金額),sum(C類的金額), sum(金額)
每一天ABC三個金額加起來為sum(金額)
(繼續閱讀...)
文章標籤

pdyurfof 發表在 痞客邦 留言(0) 人氣(220)

  • 個人分類:程式
▲top
  • 7月 09 週四 200908:56
  • C# 在DataGridView中做PasswordChar

這是在DataGridView做像TextBox的隱藏密碼的功能,
在DataGridView中的CellFormatting事件中貼上這幾行程式即可將資料用*替代
if (e.ColumnIndex != -1 && this.dataGridView1.Columns[e.ColumnIndex].Name ==  "Column.Name")
     {
(繼續閱讀...)
文章標籤

pdyurfof 發表在 痞客邦 留言(0) 人氣(841)

  • 個人分類:程式
▲top
  • 6月 24 週三 200900:05
  • CrystalReport 細目中資料並排

譬如:
-------細目-------
2008/1/1~2008/1/3
2008/1/4~2008/1/5
2008/1/6~2008/1/8
2008/1/9~2008/1/10
改成以並排顯示
-------細目-------
2008/1/1~2008/1/3 2008/1/4~2008/1/5

2008/1/6~2008/1/8 2008/1/9~2008/1/10
方法
(繼續閱讀...)
文章標籤

pdyurfof 發表在 痞客邦 留言(0) 人氣(1,685)

  • 個人分類:程式
▲top
  • 5月 06 週二 200814:27
  • base64加密與解密

//加密
public   static   string   Base64Encode(string   AStr)
{
        return   Convert.ToBase64String(Encoding.UTF8.GetBytes(AStr));
}
(繼續閱讀...)
文章標籤

pdyurfof 發表在 痞客邦 留言(0) 人氣(71)

  • 個人分類:程式
▲top
«12

最新文章

  • 買到寶MYBAO 開箱文初體驗分享
  • MapX5 載入Shp檔(中文亂碼)
  • SQLServer 取代某欄位資料
  • SQLServer 利用 SQL 找出欄位值重覆的記錄
  • SQLServer 刪除預設值、修改資料欄位
  • C# 播放音效
  • C# 在Crystal Reports 上加入圖片
  • C# base64加密與解密
  • C# Byte[] TO Image 將byte陣列儲存為圖檔
  • C# MD5加密

LovelyTime

文章精選

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: