iT邦幫忙

DAY 11
3

程式隨手寫系列 第 11

小功能(8)

  • 分享至 

  • twitterImage
  •  
string strPathDB = null;
        private void button2_Click(object sender, EventArgs e)
        {
            if (!File.Exists(strPathDB))
            {
                MessageBox.Show("檔案不存在");
                return;
            }
            string temp=DateTime.Now.Year.ToString();
            temp+=DateTime.Now.Month.ToString();
            temp+=DateTime.Now.Date.ToString();
            temp+=DateTime.Now.Hour.ToString();
            temp+=DateTime.Now.Minute.ToString();
            temp+=DateTime.Now.Second.ToString();
            temp=strPathDB.Substring(0,strPathDB.LastIndexOf("\\")+1)+temp;
            string temp2="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+temp;
            string strPathDB2="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+strPathDB;
            File.Copy(temp, strPathDB, true);
            File.Delete(temp);
            MessageBox.Show("完成");
        }

資料庫搜尋


上一篇
小遊戲
下一篇
小功能(9)
系列文
程式隨手寫20
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言