精選文章

bcp大量匯出與匯入資料庫資料方法

--匯出-- bcp "select * from [資料庫名稱].[dbo].[資料表名稱]" queryout 匯出檔案名稱.txt -w -U "使用者帳號" -P "使用者密碼" " ...

2018年5月31日 星期四

另開視窗預覽列印

方法一:
        var printPage = window.open("", "Printing...", "");
        var value = document.getElementById('PrintArea').innerHTML;
        printPage.document.open();
        printPage.document.write("<HTML><head></head><BODY onload='window.print();window.close()'>");
        printPage.document.write("<PRE>");
        printPage.document.write(value);
        printPage.document.write("</PRE>");
        printPage.document.write("</BODY></HTML>");
        printPage.document.close();

方法二:(存成圖片,但是不支援IE,且open要注意彈跳視窗問題)

var printPage = window.open("", "Printing...", "");
 html2canvas(document.getElementById('PrintArea')).then(function (canvas) {
            printPage.document.open();
            printPage.document.write("<HTML><head><title>友善列印</title>");
            printPage.document.write("</head>");
            printPage.document.write("<body style='zoom:80%' onload='window.print();window.close()'>");
            printPage.document.write("<pre style='overflow-x: hidden'>"); //寫死沒有X軸Scroll功能
            printPage.document.write("<div'>");
            printPage.document.write("<img src='" + canvas.toDataURL() + "'/>");
            printPage.document.write("</div'>");
            printPage.document.write("</pre>");
            printPage.document.write("</body></HTML>");
            printPage.document.close();

        });

2017年12月7日 星期四

CSS重點清單

CSS重點
1.      需寫在以下語法內
<style type=”text/css”>
</style>
正常都會寫在<head>裡
2.      註解為/* */,並無單行註解
3.      選擇器的重類:
l   (Type選擇器)HTML的任何一個標籤
l   (Class選擇器)以.開頭的class
l   (id選擇器)以#開頭的id
l   階層的選擇器如
ü   p span 代表p 容器裡的 span
ü   .class1 p 代表class1類別容器裡的p
ü   #myId h1 代表id(myId)容裡面的h1
4.      Grouping方式
l   如有h1,h2,h3,可以使用h1,h2,h3{  },不止type,id或class都可混合用使
5.      設定時強度比較,inline > id > class > type > inherit(繼承),!important例外使用時都可以蓋
l   Inherit(繼承)
例如:body下有<p>、<div>、<span>,當設定body時,下面的type就會被繼承到
l   type
例如:body下有<p>、<div>、<span>,當設定body,此時<p>也有設定,會蓋掉body的設定。
l   class
例如:body下有<p>、<div>、<span>,當設定body、<p>,此時class也有設定,
而<p>的class是符合的,會蓋掉<p>。
l   id
例如:body下有<p>、<div>、<span>,當設定body、<p>、class,此時id也有設定,而<p>的id是符合的,會蓋掉<p>。
l   inline
例如:body下有<p>、<div>、<span>,當設定body、<p>、class、id,而<p>內有設定style=”color:yellow”時,會蓋掉最後是yellow。
6.      !important,強制使用(強度最大),平常最好少用
7.      CSS的引入,讀外部css時要注意順序,避免設定又被覆蓋或沒有蓋
l   在<head>及</head>之間加入<link>的方式引入
<link href=”css/link.css” rel=”stylesheet” type=”text/css” />
8.      在製作CSS檔案時,副檔名為.css,檔案內開頭需打上,可以解決中文編碼問題
@charset “utf-8”;

9.      顏色參考
紅色:red 藍色:blue 灰色:gray 粉紅色:pink
綠色:green 青色:cyan 橘色:orange 亮綠:lightgreen
紫色:purple

10.  當不同選擇器有共同項目需要設定時,可以寫在一起,而不同的地方,則可以再另外自行編寫設定。
l   例如:.
div1 , .div2 , .div3{
(
共同設定項目)
}
11.  Width/Height 尺寸
l   設定寬度 width:(auto,%,px..)
ü   補充說明:div會是整個視窗寬度,而span會只限制於自己區塊內
l   設定高度 height:(auto,%,px..)
l   設定最大允許寬度 max-width(none(預設),%,px..)
l   設定最小允許寬度 min-width(%,px..)
l   設定最大允許高度 max-height(none(預設),%,px..)
l   設定最小允許高度 min-height(%,px..)
ü   補充說明:設定最小或最大允許寬度或高度時,搭配width的%這樣才會顯示效果,不然就是固定大小,如果只設定%沒有最小最大就隨著視窗大小而去變動。
12.  Display 顯示
l   Inline 為行內元素,像span
l   Black 為區塊元素,像p
l   None 不顯示
13.   

2017年12月4日 星期一

無聊的Hello World!!

程式碼:
<script type="text/javascript">
        document.write("Hello world!"+"<br>");
</script>
結果:

2017年9月15日 星期五

設定自動登入作業

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
"DefaultUserName"="使用者名稱"
"DefaultPassword"="使用者密碼"
"AutoAdminLogon"="1"

 AutoAdminLogon 機碼的值 1 (True) 為啟用 ,0 (False)為停用。

參考網址:

2017年9月3日 星期日

FTP Pubishing Service服務無法啟動,會出現「找不到指定的模組」

問題:
當FTP Pubishing Service服務無法啟動,會出現「找不到指定的模組」,
或與IIS相關的檔案損毀

解決方法:
先移除IIS
在[控制台]➔[新增或移除程式]➔[新增/移除Windows元件]➔[Application Server]
再選[Internet information Service(IIS)](網際網路資訊服(IIS),勾選掉,按確認。

安裝IIS,操作與上面相同,只差在需再勾選(網際網路資訊服(IIS),
但安裝時要確認一下裡面的項目的勾選,需有
1.全球資訊網服務
2.共用檔案
3.網際網路資訊服務管理員
4.檔案轉換通訊協定(FTP)服務

當IIS Admin Service 與 FTP Publishing Service無法啟動

當IIS Admin Service 與 FTP Publishing Service無法啟動

有可能為MetaBase.xml檔案不存在
(該檔案路徑:C:\WINDOWS\system32\inetsrv\MetaBase.xml)

解決方法:
從C:\WINDOWS\system32\inetsrv\History
,此路徑有歷史備份,copy任一個,改名覆蓋。

關閉VirtualBox Host與Guest之間的時間同步

方法1:使用cmd方式

1.使用cmd,到Host端的VirtualBox安裝目錄中,一般在
C:\Program Files\Oracle\VirtualBox\

2.可先使用該指令,查詢虛擬機所有的名稱,要選擇想要修改的名稱
VBoxManage list vms

3.再打上該指令進行修改,數值設定為1,代表關閉,設定為0,代表打開
VBoxManage setextradata "虛擬機名稱" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "1"

4.改完後再把Guest OS關機,然後Host OS也要重新開機

方法2:改vbox文件

1.找到要修改的虛擬機vbox文件,一般在
C:\User\(使用者名稱)\VirtualBox VMs\

2.找到目錄後,再根據虛擬機名稱,選擇資料夾,將虛擬機名稱.vbox文件打開

3.加入設定
<ExtraDataItem name="VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" value="1" />