發表文章

目前顯示的是 2014的文章

[ASP.net] 使用動態圖片 套 Colorbox 效果打開後亂碼

圖片
動態產生的圖,套用colorbox 會呈現一堆亂碼的樣子: 解決方式有兩種 1.由JS解決: $(document).ready(function(){ $(".group3").colorbox({ photo:true }); }); 2.動態產生圖要記得下ContentType Response.ContentType = "image/JPEG"

[Windows][Linux] 查詢連線數量(connections & sessions)

Linux: 看全部: netstat -aunt | wc -l 只看 TCP: netstat -ant | wc -l 只看 UDP: netstat -aut | wa -l Windows: 只看TCP: netstat -an | find "TCP" /c 只看UDP: netstat -an | find "UDP" /c

jQuery UI: Datepicker 設定下拉選單年份區間 set year range dropdown

 $(".txtDate").datepicker({ changeMonth: true, changeYear: true, dateFormat: 'yy-mm-dd', yearRange: "-100:+0" }); 又或著是固定年份區間: yearRange : '1950:2013' , 參考網址: http://api.jqueryui.com/datepicker/#option-yearRange

清除暫存的 DNS Cache

圖片
執行→ cmd ipconfig /flushdns 顯示清除成功,如下畫面 在Windows環境下,清除cache的指令如下: ipconfig /flushdns 在Mac OSX環境下,清除cache的指令如下: dscacheutil -flushcache 在Linux環境下,清除cache的指令如下: /etc/init.d/nscd restart

[Windows Server 2012] IIS HTTP Error 404.17 - Not Found (.NET 3.5)

Windows Server 2012 iis8 與.NET 3.5 iis安裝好,一開始並沒有安裝.NET 3.5 (但是.NET CLR VERSION卻又可以選擇2.0) 所以發生了IIS HTTP Error 404.17 - Not Found 這個錯誤 直接去找連結下載3.5的安裝包是不可行的 所以,必須要去介面將.NET 3.5 增加 以下內容節錄至msdn To install .NET 3.5 on Windows Server 2012 or Windows 8 On the  Start  screen, right-click the  Command Prompt  tile, and then click  Run as administrator . At the command prompt, type the following:  dism /online /enable-feature /featurename:netfx3 Wait for the command to complete. It could take several minutes. Close the command prompt window. To install IIS and ASP.NET modules on Windows Server 2012 using the UI On the  Start  page, click the  Server Manager  tile, and then click  OK . In  Server Manager , select  Dashboard , and click  Add roles and features . In the  Add Roles and Features Wizard , on the  Before you begin  page, click  Next . On the  Select installation type  page, select Role-based or feature-based installation, and click  Next .

[IIS] [ASP]IIS7.0上傳檔限制的解決方法

IIS7.0的修改方法 打開IIS → 「ASP」→ 打開「限制內容」; 修改「要求實體的上限」的值,預設值為200000(約200KB) 把它修改為你想修改的大小,如:52000000(50MB) 修改完成點擊「套用」 iis7 上傳大檔限制的真正解決辦法 打開「IIS」; 按兩下「Default Web Site「→按兩下中間窗格中的「要求篩選」→按一下右側窗格的「編輯功能設置」→修改「請求限制」下面的「允許的最大內容長度」,預設是30M,隨便改大一點,我改成300M,點擊「確定」; 重新開機IIS,再上傳試試,50M、90M都可以了。 IIS6.0的修改方法 在IIS中右鍵「本地電腦」選擇「屬性」,鉤選「允許直接編輯設定資料庫」; 在服務裡關閉「IIS Admin Service」服務; 找到c:\windows\system32\inetsrv\下的「MetaBase.xml」,打開,找到「AspMaxRequestEntityAllowed 」把他修改為需要的值,預設為204800,即200k ,把它修改為51200000(50MB); 然後重啟「IIS Admin Service"服務。 在 IIS 6.0 中,無法下載超過4M的附件時,可以按以下步驟解決 : 先在服務裡關閉 iis admin service 服務。 找到 windows\system32\inetsrv\ 下的 metabase.xml 檔。 用純文字方式打開,找到 AspBufferingLimit 把它修改為需要的值,預設為4194304(可修改為20M即:20480000)。 存檔,然後重啟 iis 服務。

[MSSQL]ALTER TABLE 新增修改刪除欄位語法

新增欄位: ALTER TABLE table_name ADD column_name datatype 刪除欄位: ALTER TABLE table_name DROP COLUMN column_name 修改欄位型態: ALTER TABLE table_name ALTER column_name datatype

[ASP.NET] 繁簡直接轉換

繁轉簡 ''' ''' 覆寫 Render 方法做繁轉簡的動作。 ''' Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter) Dim HtmlStr As String Dim oStringWriter As New StringWriter() Dim oHtmlWriter As New HtmlTextWriter(oStringWriter) MyBase.Render(oHtmlWriter) oHtmlWriter.Flush() oHtmlWriter.Close() '取得網頁的輸出內容做繁體中文轉簡體中文的動作 HtmlStr = StrConv(oStringWriter.ToString(), VbStrConv.SimplifiedChinese, 2052) Response.Write(HtmlStr) End Sub 簡轉繁 VbStrConv.TraditionalChinese, 2052

[ASP.NET] ashx(泛型處理常式)中存取Session(工作階段變數)

原本的ashx Imports System <%@ WebHandler Language="VB" Class="Handler" %> Imports System Imports System.Web Public Class Handler : Implements IHttpHandler Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest context.Response.ContentType = "text/plain" context.Response.Write("Hello World") End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property End Class

XML特殊字元處理

Xml 是標記指電腦所能理解的資訊符號 除了結構及標籤屬性的對應 以下xml特殊字元必須過濾,才不會造成瀏覽器解析錯誤 特殊字元 替代字元 <   &lt; >   &gt; & &amp; ' &apos; " &quot;

[Win 8]遠端桌面連線,帳密登入卻顯示認證失敗

圖片
遠端桌面連線無法連到 win 8 , 出現訊息:您的認證無效 開啟遠端桌面, 輸入遠端 IP 後, 點選下方"另存新檔",  將設定值另存為xxx.rdp 用記事本打開 在第一行加入 enablecredsspsupport:i:0 點擊剛剛的檔案 再登入即可

[MS-SQL]訊息 15281 SQL Server 已封鎖元件 'Ad Hoc Distributed Queries' 的 STATEMENT 'OpenRowset/OpenDatasource' 之存取

圖片
訊息 15281,層級 16,狀態 1,程序 ,行 1 SQL Server 已封鎖元件 'Ad Hoc Distributed Queries' 的 STATEMENT 'OpenRowset/OpenDatasource' 之存取,因為此元件已經由此伺服器的安全性組態關閉。系統管理員可以使用 sp_configure 來啟用 'Ad Hoc Distributed Queries' 的使用。如需有關啟用 'Ad Hoc Distributed Queries' 的詳細資訊,請參閱《SQL Server 線上叢書》中的<介面區組態>(Surface Area Configuration)。 Msg 15281, Level 16, State 1, Procedure , Line 1 SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online. 解決方式: 在資料庫按右鍵選擇 Facet 將第一項AdHocRemoteQueriesEnabled 設定為 True

iis 允許 .json mime type .json

圖片
step1:開啟IIS 開啟MIEI類型 step2:使用右上方的新增 step3:將以下資訊填入 Extension: .json MIME type: application/json

[Windows]密碼複雜性需求 停用密碼複雜度

圖片
「適用:Windows 2008 Server、window 7、windows 8」 密碼必須符合複雜性需求 如果啟用了此原則,則密碼必須符合下列最小需求: 不包含使用者的帳戶名稱全名中,超過兩個以上的連續字元 長度至少為 6 個字元 包含下列四種字元中的三種: 英文大寫字元 (A 到 Z) 英文小寫字元 (a 到 z) 10 進位數字 (0 到 9) 非英文字母字元 (例如: !、$、#、%) 建立或變更密碼時會強制執行複雜性需求。 如果要停用密碼複雜度 方法一 -------------------------------------------------------------------------------------------------- .在搜尋程式的地方輸入   secpol.msc  .選擇:帳戶原則   .選擇:密碼原則

[asp.net] Office匯入: Microsoft Access Database Engine 2010 可轉散發套件

圖片
需使用excel匯入時,當server 沒有裝office 時 需安裝: Microsoft Access Database Engine 2010 可轉散發套件 下載: http://www.microsoft.com/zh-tw/download/details.aspx?id=13255

[asp.net] 伺服器認可通訊協定違規. Section=ResponseStatusLine

圖片
錯誤訊息:伺服器認可通訊協定違規. Section=ResponseStatusLine

[google map api] 用經緯度計算兩點的距離

用經緯度計算兩點的距離  var distance = new GLatLng(39.917, 116.397).distanceFrom(new GLatLng(37.4419, -122.1419)); alert(parseInt(distance/1000,10) + "公里"); 相關參考: https://developers.google.com/maps/documentation/javascript/v2/reference#GLatLng.GLatLng

分析網頁效能工具 網站效能優化

圖片
Google 分析網頁效能工具 https://developers.google.com/speed/pagespeed/insights/ 1.首先將需要分析的網址鍵入, 2.等待分析完畢後,依提示手機版及電腦版,分別將網站修正、微調,即可達到優化效果 。 另一國外網站方法類似,亦可交叉測試 http://gtmetrix.com/

[MS SQL] 資料庫,資料表 查詢型態

.查詢此主機所有資料庫 SELECT * FROM sys.databases .查詢此資料庫所有資料表 SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'; SELECT Distinct TABLE_NAME FROM information_schema.TABLES .查詢資料表內的型態    sp_help Table_Name   Select * From INFORMATION_SCHEMA.COLUMNS Where TABLE_NAME = 'Table_Name' 官方文件參考: sp_help:  http://technet.microsoft.com/en-us/library/ms187335.aspx

Internet Explorer User Agent Strings

Internet Explorer 各版本的 User Agent Strings Internet Explorer 10.6 Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0 Internet Explorer 10.0 Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0) Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0) Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0) Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/4.0; InfoPath.2; SV1; .NET CLR 2.0.50727; WOW64) Mozilla/5.0 (compatible; MSIE 10.0; Macintosh; Intel Mac OS X 10_7_3; Trident/6.0) Mozilla/4.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0) Mozilla/1.22 (compatible; MSIE 10.0; Windows 3.1) Internet Explorer 9.0 Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US)) Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US) Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0) Mozilla/5.

解決 ADO.NET 建立 Oracle 資料庫連線的問題

你在 ASP.NET 嘗試使用 System.Data.OleDb.OleDbConnection 來開啟 Oracle 資料庫連線時,可能會發生如下的錯誤訊息: 找不到 Oracle 用戶端及網路元件。這些元件由 Oracle 公司供應且為 Oracle 8i 以上版本用戶端軟體安裝的一部分。在安裝這些元件前您無法使用此提供者。 如果是使用 System.Data.OracleClient 則會發生如下的錯誤訊息: System.Data.OracleClient requires Oracle client software version 8.1.7 or greater. 因為使用 .NET Framework Data Provider 存取 Oracle 資料庫,需要安裝 Oracle 用戶端軟體 8.1.7 版及更新版本。如果你是在未安裝 Oracle 用戶端軟體的情況下發生這樣的問題,你可以造訪 Oracle 官方網站,下載 Oracle Data Access Components (ODAC)。下載完成後,請執行安裝程式,並在安裝過程中選擇安裝 Oracle Data Provider for .NET。 若是在已安裝 Oracle 用戶端軟體的情況下,可能是 ORACLE_HOME 安裝在 Windows NTFS 磁碟分割區, 導致 ASP.NET 所使用的 Authenticated User 權限找不到 ORACLE_HOME 目錄,才導致這樣的錯誤。 解決方法: 以具有修改權限的管理者身分登入 Windows。 使用檔案總管開啟 ORACLE_HOME 資料夾,並點選 [安全性] 頁籤。 點選 [Authenticated Users] 。在下方權限清單中,取消 [讀取及執行] 項目的核取方塊,並按下 [套用]。 按下 [進階] 按鈕,確認 [Authenticated Users] 的權限是 [讀取及執行] ,且套用在 [這個資料夾,子資料夾及檔案] 。 按下 [確定] 按鈕,直到關閉資料夾內容對話盒。 重新啟動 Windows。 相關元件: Instant Client Downloads  或安裝   Oracle Data Access Compon

centos postfix 開放 http 寄信

要讓網站可以寄信 除了安裝postfix 及基本設定之外 還有一個重要的關鍵 首先,先利用以下指令查詢: getsebool -a | grep http 或 getsebool -a | grep httpd_can_sendmail 看看httpd_can_sendmail 這個值的設定值 預設為off httpd_can_sendmail --> off

PayPal 按鈕 出現:"數據與輸入的字符集或默認編碼不符。"

圖片
数据与输入的字符集或默认编码不符。如需更多信息,请联系商家。 解決使用 PayPal 贊助按鈕時,出現[數據與輸入的字符集或默認編碼不符。 使用 PayPal 按鈕時,出現"數據與輸入的字符集或默認編碼不符。 就是編碼不符,只要在原有產生的按鈕文字下加上

CentOS Zip Unzip 壓縮 解壓縮 檔案或資料夾

壓縮資料夾 zip -r data.zip datafloder 壓縮單一檔案 zip  data.zip fileName.txt 解壓縮檔案 unzip data.zip

ubuntu 圖形模式 文字模式 切換

ubuntu 在一般圖形化模式切換至文字模式... Ctrl+Alt+F1 在一般文字切換至圖形化模式 ... Alt+F7