UWInfo Blog
發表新文章
[Join] | [忘記密碼] | [Login]
搜尋

搜尋意見
文章分類-#Author#
[所有文章分類]
所有文章分類
  • ASP.NET (48)
  • ASP.NET2.0 (15)
  • ASP.NET4.0 (34)
  • JavaScript (49)
  • jQuery (26)
  • FireFox (4)
  • UW系統設定 (3)
  • SQL (39)
  • SQL 2008 (25)
  • mirror (4)
  • SVN (4)
  • IE (9)
  • IIS (20)
  • IIS6 (1)
  • 閒聊 (7)
  • W3C (6)
  • 作業系統 (9)
  • C# (24)
  • CSS (12)
  • FileServer (1)
  • HTML 5 (11)
  • CKEditor (3)
  • UW.dll (13)
  • Visual Studio (16)
  • Browser (8)
  • SEO (1)
  • Google Apps (3)
  • 網站輔助系統 (4)
  • DNS (5)
  • SMTP (4)
  • 網管 (11)
  • 社群API (3)
  • SSL (4)
  • App_Inventor (1)
  • URLRewrite (2)
  • 開發工具 (6)
  • JSON (1)
  • Excel2007 (1)
  • 試題 (3)
  • LINQ (1)
  • bootstrap (0)
  • Vue (3)
  • IIS7 (3)
  • foodpanda (2)
  • 編碼 (2)
  • 資安 (3)
  • Sourcetree (1)
  • MAUI (1)
  • CMD (1)
  • my sql (1)
最新回應
  • Newtonsoft.Json.JsonConvert.DeserializeObject 失敗的情況
    test...more
  • dotnet ef dbcontext scaffold
    ...more
  • [ASP.NET] 利用 aspnet_regiis 加密 web.config
    ...more
  • IIS ARR (reverse proxy) 服務安裝
    ...more
  • [錯誤訊息] 請加入 ScriptResourceMapping 命名的 jquery (區分大小寫)
    ...more
  • 用 Javascript 跨網頁讀取 cookie (Cookie cross page, path of cookie)
    ...more
  • 線上客服 - MSN
    本人信箱被盜用以致資料外洩,是否可以請貴平台予以協助刪除該信箱之使用謝謝囉...more
  • 插入文字到游標或選取處
    aaaaa...more
  • IIS 配合 AD (Active Directory) 認証, 使用 .Net 6.0
    太感謝你了~~~你救了我被windows 認證卡了好幾天QQ...more
  • PostgreSQL 的 monitor trigger
    FOR EACH ROW 可能要改為 FOR EACH STATEMENT ...more
標籤
  • Ttzdu6Pf
  • [u2]
  • timeout
  • 1
  • 856
  • 486
  • 826
  • ??21211211
  • sqlcmd
  • 1833
  • 0,
  • if21211211
  • -2484 UNIO
  • 422
  • .net core
  • 備註
  • [t],
  • CK
  • -1844 UNIO
  • my sql
  • 貼
  • Operation
  • big5 order
  • tim
  • C
  • ENum
  • 644
  • http 錯èª
  • HTML
  • gM8ynCeE
  • 1602
  • spf
  • unt
  • 138
  • message,
  • Chrome2121
  • IIS匯出
  • 上傳圖片
  • LINE
  • face,
  • ajaxupload
  • 1498
  • 774
  • MaxHttpCol
  • js UNION A
  • ${91940214
  • 火狐
  • 62expr 952
  • cA2yeXPF
  • mssql
頁數 6 / 8 上一頁 下一頁
搜尋 0, 結果:
整理一下最近 IE9 (或以下) 的問題,順便補一個 Firefox 的問題
IE一直到 IE10 才比較支援一般正常瀏覽器的功能
IE9 以下常常要做一些特別的處理 稍微整理一下

1. input, textarea 的 "placeholder" 屬性,IE10 以上才支援,建議偵測 IE9 以下版本時,特別跑 js 用 onfocus, onblur    來處理

    function setPlaceholder(e) {
        var placeholder = $(this).attr('placeholder');
        if ($(this).val().length == 0) {
            $(this).css("color", "#b2b2b2").val(placeholder);
        }

        $(this).focus(function (e) {
            if ($(this).val() == placeholder) { $(this).css("color", "#666").val(""); }
        });

        $(this).blur(function (e) {
            if ($(this).val().length == 0) { $(this).css("color", "#b2b2b2").val(placeholder); }
        });
    }

    if (Is_LTE_IE9) {
        $('input[placeholder]').each(setPlaceholder);
        $('textarea[placeholder]').each(setPlaceholder);
    }


2. <input type=file /> 不能用 js 去 click,必須要user真的去點他, js 才抓得到檔案,不然傳到server也是空的
   
3. IE9 的 js console.log 必須在 "偵錯模式" 下才能使用,所以js程式完成後,要記得把 console.log 清掉或是註解掉
   不然一般 IE9 的 User 會跳出 js 的錯誤,然後 js 就停了。(這個問題必須在純IE9的瀏覽器才能發現,IE10模擬IE9也發    現不到)

4. Firefox 問題: 當我們要算div的寬高時,他本身必須 display:block 才能算的出來,不然會是 0,
   但是 Firefox 連隱藏iframe 裡的 html > div 都會回傳 0,必須把 iframe 設為 display:block;visibility:hidden
  才能算出裡面div的寬高
 
More...
darren, 2013/11/15 上午 10:13:29
Method 'get_EnableCdn' in type 'System.Web.UI.ScriptManager' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.

解法:

http://stackoverflow.com/questions/5341324/method-get-enablecdn-in-type-system-web-ui-scriptmanager-from-assembly-syst
More...
Reiko, 2013/9/11 下午 12:22:32
DataTable 的 Rows.Find 效能較佳
因為 SHOPUNT 的線上產品有兩千多筆,然後網站有非常頻繁的查詢
例如檢查產品是否停賣

原本的寫法是用以下方法尋找

DT.Select("Id=" & ProductId) 


後來改寫 DataTable 加上 PrimaryKey

'寫入Cache前先設定好
DT.PrimaryKey = New DataColumn() {obj.Columns("Id")} 
Dim row As DataRow = DT.Rows.Find(ProductId)


共1085筆 找出其中一筆 
Select方法  - 00:00:00.0000559
Rows.Find -   00:00:00.0000064

兩者速度差了約10倍
 
More...
darren, 2013/9/5 上午 11:58:39
Cross site ajax
今天去亞卡讀書會剛好有提到跨站的 ajax
除了JSONP之外,其實W3C也有訂標準
http://www.w3.org/TR/cors/
https://developer.mozilla.org/zh-TW/docs/HTTP/Access_control_CORS
基本精神就是
A網站呼叫B網站
A網站的Request Header要加上 Origin: (這個瀏覽器會自動加上)
B網站Response Header要加上一些 Access-Control-Allow-Origin:
這樣就可以通了 不過Request並不會帶上B網站的cookies
若是希望 Request 時也要送上 cookies 資訊,則http物件要加上 .withCredentials = true
不過 IE7以下確定是不支援這的機制,IE8以上則還要測看看

 
More...
darren, 2013/5/14 下午 11:40:25
compilerVersion Error

提供者選項中 'compilerVersion' 屬性的值必須是 'v4.0' 以上 (如果要針對 4.0 版以後的 .NET Framework 編譯)。若要針對 3.5 (含) 以後版本的 .NET Framework 編譯這個 Web 應用程式,請從 Web.config 檔案的 <compilation> 項目移除 'targetFramework' 屬性。


<system.codedom>
    <compilers>
     <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
        <providerOption name="CompilerVersion" value="v4.0"/>
        <providerOption name="WarnAsError" value="false"/>
     </compiler>
     <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
        <providerOption name="CompilerVersion" value="v4.0"/>
        <providerOption name="OptionInfer" value="true"/>
        <providerOption name="WarnAsError" value="false"/>
     </compiler>
    </compilers>
</system.codedom>


相關專案: 光寶
More...
Reiko, 2013/5/10 上午 10:14:22
MRTG 監控系統設定
查了監控 snmp 的套件,還是 mrtg 最簡單,做個紀錄一下

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
先安裝 windows server snmp 服務,啟動​並進行設定

可參考:http://blog.faq-book.com/?p=1799
設定 public 的地方需輸入,會與 mrtg 的設定有關

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
安裝 ActivePerl,並下載解壓 mrtg 到任意目錄
官網:http://mrtg.cs.pu.edu.tw/download.en.html

這裏以 c:\mrtg 為例

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
設定 c:\mrtg\bin\127.0.0.1.cfg, 並執行 c:\mrtg\bin\perl mrtg 127.0.0.1.cfg 可跑一次
會產生 html&圖 到 WorkDir: 下,再設成 iis web 即可

c:\mrtg\bin\127.0.0.1.cfg 範例
#設為背景服務
RunAsDaemon: no

#統計間隔(預設5分鐘 Interval:5)
Interval:5

#網頁訊息中文顯示
Language: big5

#瀏覽器重新讀取間隔(預設Refresh:300秒)
Refresh:300
WorkDir: c:\inetpub\wwwroot\mrtg
EnableIPv6: no

########################################################
# 127.0.0.1 CPU Loading
########################################################
Target[127.0.0.1-cpu]: .1.3.6.1.2.1.25.3.3.1.2.1&.1.3.6.1.2.1.25.3.3.1.2.2:public@127.0.0.1
Title[127.0.0.1-cpu]: CPU Loading
PageTop[127.0.0.1-cpu]: </code><h1>CPU Loading - 127.0.0.1</h1>
Colours[127.0.0.1-cpu]: R#ff4f27,Y#FFFF00,,R#ff4f27,Y#FFFF00
MaxBytes[127.0.0.1-cpu]: 100
Options[127.0.0.1-cpu]: gauge, nopercent, growright
Directory[127.0.0.1-cpu]: 127.0.0.1
YLegend[127.0.0.1-cpu]: CPU loading (%)
ShortLegend[127.0.0.1-cpu]: %
Legend1[127.0.0.1-cpu]: CPU1 負載
Legend2[127.0.0.1-cpu]: CPU2 負載
LegendI[127.0.0.1-cpu]: CPU1 負載
LegendO[127.0.0.1-cpu]: CPU2 負載


[127.0.0.1-cpu] 為產生檔名
Directory[127.0.0.1-cpu]: 127.0.0.1 會建立 127.0.0.1 的目錄來放 html&圖

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
建立 bat 排程每五分跑一次即可

mrtg.bat
perl mrtg 192.168.0.10.cfg
perl mrtg 192.168.0.20.cfg

rem 幫你建立 index.html
perl indexmaker --output c:\inetpub\wwwroot\mrtg\index.html 192.168.0.10.cfg 192.168.0.20.cfg


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
較麻煩的是 Target 的設定,為 snmp 的節點值,跟效能監視器裏的項目有點像

查到的較有用的
CPU Loading
Target[127.0.0.1-cpu]: .1.3.6.1.2.1.25.3.3.1.2.1&.1.3.6.1.2.1.25.3.3.1.2.2:public@127.0.0.1
其中 .1.3.6.1.2.1.25.3.3.1.2 固定,.1 .2 隨不同機器的 cpu 數 .3 .4 都有可能

Current Connections
Target[192.168.0.10-webusers]: .1.3.6.1.4.1.311.1.7.3.1.13.0&.1.3.6.1.4.1.311.1.7.3.1.14.0:public@127.0.0.1

Network Usage
Target[192.168.0.10-network]: \Realtek\ PCIe\ GBE\ Family\ Controller:public@127.0.0.1
這裏都會跟網卡名綁,通常用執行
perl cfgmaker --global "WorkDir: c:\inetpub\wwwroot\mrtg" --ifref=descr --ifdesc=descr public@127.0.0.1 --output network.cfg
它會幫你跑一遍路的節點,再挑出來用即可

Cpu 溫度找不到內建通用的,要安裝第三方套件,開其它篇寫

查到最完整的第三方提供 snmp 統整節點,但要錢,免費版節點很少,也沒有溫度

http://www.snmp-informant.com/
http://www.snmp-informant.com/products/std/snmp-informant-std-tree.htm 免費版節點

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
結果圖








 
More...
Jerry, 2013/4/13 下午 03:18:47
SQL 2008 資料庫的復原
1. "有疑問"的 資料庫的修復:

ALTER DATABASE MyDB SET EMERGENCY;
DBCC checkdb('MyDB');
ALTER DATABASE MyDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DBCC CheckDB ('MyDB', REPAIR_ALLOW_DATA_LOSS);
ALTER DATABASE MyDB SET MULTI_USER;

其中 "DBCC CheckDB ('MyDB', REPAIR_ALLOW_DATA_LOSS)" 可能要多執行幾次。

2. Restore Differential Backup 用的 SQL:
​
RESTORE DATABASE [MyDB] FROM  DISK = N'D:\BACKUP_DB\MyDB_backup.bak' WITH  FILE = 1,  NORECOVERY,  NOUNLOAD,  REPLACE,  STATS = 10,
MOVE 'MyDB_Data' TO 'D:\SQLDB2008\MyDB.mdf', 
MOVE 'MyDB_Log' TO 'D:\SQLDB2008\MyDB.ldf'

RESTORE DATABASE [MyDB] FROM  DISK = N'D:\BACKUP_DIFF\MyDB_backup_2013_02_25_12.bak' WITH  FILE = 1,  NOUNLOAD, NORECOVERY,  STATS = 10

RESTORE DATABASE [MyDB] WITH RECOVERY (正在還原的資料庫也可以用這個指令來恢復成可使用的狀態)
More...
Bike, 2013/2/26 上午 10:58:40
IE Cookie 奇怪的問題
A Domain 底下有一個 B Domain 的 iFrame,B Domain 在client 有對自己的domain 設些cookie,
但 IE cookie 寫不進去,

原因如下面網址: http://www.cr173.com/html/16696_1.html
加入這行 IE 就好囉!   Response.AddHeader("P3P", "CP=CAO PSA OUR")
More...
瞇瞇, 2013/1/30 下午 07:58:45
Server Error - 由於該物件目前的狀態,導致作業無效。

 ASP.NET 在處理 HTTP POST 要求時最多只能接受 1,000 個參數,一般來說不會有人透過 POST 傳遞表單資料超過 1,000 個欄位 ( 以筆者的經驗來說,傳過最多的一次是 700 個欄位,當時是個問卷系統 ),如果傳數參數超過 1,000 筆的話,就會出現 Operation is not valid due to the current state of the object. (英文) 或 由於該物件目前的狀態,導致作業無效。 (中文) 例外狀況,細部的例外訊息會有 HttpException (0x80004005): The URL-encoded form data is not valid. (英文) 或 HttpException (0x80004005): URL 編碼型式資料無效。
參考:http://blog.miniasp.com/post/2012/01/01/Efficient-Denial-of-Service-Attacks-on-Web-Application-Platforms.aspx

解:
web.config加下面這個設定
<appSettings>
     <add key="aspnet:MaxHttpCollectionKeys" value="5000" />
</appSettings>
 
More...
Reiko, 2012/8/15 下午 06:39:13
XmlWriter 之 UTF-16 問題
當我們使用 XmlWriter 配合 StringBuilder 建立xml文件時,會產生結果是 UTF-16 的 xml 文件
即使 XmlWriter 有配合 XmlWriterSetting 設定為 UTF-8 但結果還是 UTF-16
我網路上找了一下解決方式 整理出以下是比較好的解決方式 請參考程式碼
最終還是要靠 StreamReader 轉一次

        Encoding enc = Encoding.UTF8;
        XmlWriterSettings xws = new XmlWriterSettings();
        xws.Encoding = enc;
        xws.Indent = true;
        MemoryStream ms = new MemoryStream();
        string strXml = "";
        using (XmlWriter writer = XmlWriter.Create(ms, xws))
        {
 
            writer.WriteStartDocument();
            writer.WriteStartElement("rss");
            writer.WriteAttributeString("version", "2.0");
 
            writer.WriteStartElement("channel");
 
            // channel data
            writer.WriteElementString("title", "最新文章");
            ...(XML 資料)......
 
            writer.WriteEndElement(); // channel end
 
            writer.WriteEndElement(); //rss end
            writer.WriteEndDocument();
 
            writer.Flush();
            
            StreamReader reader = new StreamReader(ms, enc, true);
            ms.Seek(0, SeekOrigin.Begin);
            strXml = reader.ReadToEnd();
        }
More...
darren, 2012/8/9 下午 12:56:25
|< 12345678 >|
頁數 6 / 8 上一頁 下一頁
~ Uwinfo ~