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
標籤
  • for2121121
  • 專案
  • 878
  • for order
  • fancybox
  • User
  • HTTP 錯誤 40
  • .net
  • asp.ne
  • -3679
  • NSwag
  • smtp
  • .
  • sVN
  • replace
  • pg2008
  • ef
  • 安裝
  • net2121121
  • orm
  • login
  • mod order
  • 774
  • if21211211
  • ClientIP
  • 500.19
  • 600
  • db
  • EN
  • AutoPostBa
  • 874
  • 指令
  • firewall O
  • cpu
  • VS
  • 554
  • aspnet_reg
  • cors
  • Xml
  • -3643
  • this
  • pg
  • a
  • 5009
  • email21211
  • ad
  • fb
  • Needs Lock
  • div
頁數 5 / 5 上一頁
搜尋 User 結果:
SQL 2008 內建備份功指定到網路磁碟機
不同主機,windows登入帳號不同時,需先指定帳密才可備份。

-- To allow advanced options to be changed.開啟進階選項
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.執行動作
RECONFIGURE
GO
-- To enable the feature.開啟xp_cmdshell功能
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.執行動作
RECONFIGURE
GO


DECLARE @DBPath nvarchar(120)
--指定磁碟機Z的路徑為\\192.168.8.201\SQLBackupLeon
exec master..xp_cmdshell 'net use z: \\192.168.8.201\SQLBackupLeon 密碼 /user:帳號'
--指定備份路徑檔名
SET @DBPath = 'Z:\' + 'ReikoTEST' + '_' + Convert(varchar(10),Getdate(),112) + Replace(Convert(varchar(8),Getdate(),108),':','') + '.bak'
--DATENAME(Weekday,GETDATE())=>會顯示為"星期N"
--SET @DBPath = 'Z:\' + 'Leon' + '_' + DATENAME(Weekday,GETDATE()) + '.bak'
--備份資料庫ReikoTEST到路徑檔名
BACKUP DATABASE ReikoTEST TO DISK = @DBPath
--刪除磁碟機Z
exec master..xp_cmdshell 'net use Z: /delete'
GO


-- To enable the feature.關閉xp_cmdshell功能
EXEC sp_configure 'xp_cmdshell', 0
GO
-- To update the currently configured value for this feature.執行動作
RECONFIGURE
GO
-- To allow advanced options to be changed.關閉進階選項
EXEC sp_configure 'show advanced options', 0
GO
-- To update the currently configured value for advanced options.執行動作
RECONFIGURE
GO


※ xp_cmdshell不要常開著,有風險,用完要關掉。
※ 網路磁碟機路徑要開啟安全性設定,設定為:\\[IP]\[資料夾],不可用\\[IP]\D$\[資料夾]
※ net use 指定資料夾後方,不可加 \
參考資料:http://ithelp.ithome.com.tw/question/10086406
More...
Reiko, 2013/12/12 上午 10:36:00
整理一下最近 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
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
網頁端不同時區之時間顯示

由於網站的user來自全世界各地,而我們網站產生的時間卻是Server的時間
因此需要使用javascript來做一些轉換,讓user看到是他當地的時間

1. Server端產生具有時區的時間字串,用特定的span + class把它包起來, 時間格式 DateTime.ToUniversalTime().ToString("r")
     
<span class="timeString">Fri, 31 Aug 2012 10:57:04 GMT</span>

2. Client端利用jQuery於網頁load的時候將所有時間轉換成當地時間
    這個地方我用了  date.format.js 來轉換成當地時間 (參考  http://blog.stevenlevithan.com/archives/date-time-format  )
   

     $(".timeString").each(function () {
            var content = $(this).text();
            var d = new Date(content);
            if (!isNaN(d)) $(this).text(d.format("yyyy-mm-dd hh:MM tt"));
        }); 
   

這樣user看到的時間就不會錯了
More...
darren, 2012/6/19 下午 04:14:57
使用 Net.WebRequest 出現 ''已經嘗試太多次自動重新導向'' 的解決方法

當使用 WebRequest 來 Get 網址時,出現"已經嘗試太多次自動重新導向"。

通常為對方網站有進行某種判斷。以下為試過的項目。

上次是將 CookieContainer 設定一個 New Net.CookieContainer 即可。

            Dim http As Net.HttpWebRequest = Net.WebRequest.Create(Url)
            http.Method = "GET"
            http.ContentType = "application/x-www-form-urlencoded;"

            http.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Win64; x64; Trident/5.0)"
            http.CookieContainer = New Net.CookieContainer
            http.Referer = Url

More...
Jerry, 2012/6/18 下午 07:54:03
global.asax 的事件
從 http://blog.ie-soft.de/post/2007/12/globalasax-events.aspx  抄來的. 留作參考

HttpApplication Events:

Application_AcquireRequestState
Occurs when ASP.NET acquires the current state (for example, session state) that is associated with the current request. 

Application_AuthenticateRequest
Occurs when a security module has established the identity of the user. 

Application_AuthorizeRequest
Occurs when a security module has verified user authorization. 

Application_BeginRequest
Occurs as the first event in the HTTP pipeline chain of execution when ASP.NET responds to a request. 

Application_Disposed
Adds an event handler to listen to the Disposed event on the application. 

Application_EndRequest
Occurs as the last event in the HTTP pipeline chain of execution when ASP.NET responds to a request. 

Application_Error
Occurs when an unhandled exception is thrown. 

Application_PostAcquireRequestState
Occurs when the request state (for example, session state) that is associated with the current request has been obtained. 

Application_PostAuthenticateRequest
Occurs when a security module has established the identity of the user. 

Application_PostAuthorizeRequest
Occurs when the user for the current request has been authorized. 

Application_PostMapRequestHandler
Occurs when ASP.NET has mapped the current request to the appropriate event handler. 

Application_PostReleaseRequestState
Occurs when ASP.NET has completed executing all request event handlers and the request state data has been stored. 

Application_PostRequestHandlerExecute
Occurs when the ASP.NET event handler (for example, a page or an XML Web service) finishes execution. 

Application_PostResolveRequestCache
Occurs when ASP.NET bypasses execution of the current event handler and allows a caching module to serve a request from the cache. 

Application_PostUpdateRequestCache
Occurs when ASP.NET completes updating caching modules and storing responses that are used to serve subsequent requests from the cache. 

Application_PreRequestHandlerExecute
Occurs just before ASP.NET begins executing an event handler (for example, a page or an XML Web service). 

Application_PreSendRequestContent
Occurs just before ASP.NET sends content to the client. 

Application_PreSendRequestHeaders
Occurs just before ASP.NET sends HTTP headers to the client. 

Application_ReleaseRequestState
Occurs after ASP.NET finishes executing all request event handlers. This event causes state modules to save the current state data. 

Application_ResolveRequestCache
Occurs when ASP.NET completes an authorization event to let the caching modules serve requests from the cache, bypassing execution of the event handler (for example, a page or an XML Web service). 

Application_UpdateRequestCache
Occurs when ASP.NET finishes executing an event handler in order to let caching modules store responses that will be used to serve subsequent requests from the cache. 

Application_Init
This method occurs after _start and is used for initializing code. 

Application_Start
As with traditional ASP, used to set up an application environment and only called when the application first starts.

Application_End
Again, like classic ASP, used to clean up variables and memory when an application ends.

Session Events:

Session_Start
As with classic ASP, this event is triggered when any new user accesses the web site.

Session_End
As with classic ASP, this event is triggered when a user's session times out or ends. Note this can be 20 mins (the default session timeout value) after the user actually leaves the site.

Profile Events:

Profile_MigrateAnonymous
Occurs when the anonymous user for a profile logs in.

Passport Events:

PassportAuthentication_OnAuthenticate
Raised during authentication. This is a Global.asax event that must be named PassportAuthentication_OnAuthenticate.
 

Possibly more events defined in other HttpModules like:

System.Web.Caching.OutputCacheModule
System.Web.SessionState.SessionStateModule
System.Web.Security.WindowsAuthentication
System.Web.Security.FormsAuthenticationModule
System.Web.Security.PassportAuthenticationModule
System.Web.Security.UrlAuthorizationModule
System.Web.Security.FileAuthorizationModule
System.Web.Profile.ProfileModule

More...
Bike, 2012/6/9 上午 08:55:08
便用非管理者帳戶來執行網站, 會遇到載入 DLL 的問題 -- 無法載入檔案或組件 XXX 或其相依性的其中之一。 存在某個不正常的 API 呼叫。
我今天試著建立一個一般的使用者帳號來執行某個網站 (<identity impersonate="true" userName="XXX" password="abcdefg"/>) , 遇到以下的問題, 結果把該使用者加入 IIS_IUSRS 就 OK 了.

無法載入檔案或組件 'FredCK.FCKeditorV2' 或其相依性的其中之一。 存在某個不正常的 API 呼叫。 (發生例外狀況於 HRESULT: 0x800300FA (STG_E_ABNORMALAPIEXIT))

 
More...
Bike, 2012/6/9 上午 08:26:48
SVN 新增的檔案自動加入 Needs Lock 的屬性 on Windows 2008
網路上有很多介紹, 但最討厭的是每個 OS 的設定檔的位置都不太一樣, 在 Windows 2008 下面, 設定檔位於

C:\Users\XXX\AppData\Roaming\Subversion\config

我是直接在最後面加了一行:

* = svn:needs-lock=true

讓所有新增的檔案都有 Needs-Lock 的屬性.
More...
Bike, 2012/5/3 下午 04:15:49
排名 rank

select RANK() over (order by username) as ranking, *
from member
where Email like '%reiko%'
order by Username desc

More...
Reiko, 2012/4/13 下午 07:29:44
|< 12345 >|
頁數 5 / 5 上一頁
~ Uwinfo ~