找到一個外國人寫的判斷語系 , 的  sitemap , 就有文章說 , 那網頁能判斷 瀏覽器語系 然後簡體字就簡體 , 繁體瀏覽器就繁體 , 日語瀏覽器就日語 , 其他就英文 ........
我家網頁是用 session 內的變數 lanage 來切換語系的 ....那就改一改 , 將初始化改直接定義 _session['lanage'] 為瀏覽器語系

echochio 發表在 痞客邦 留言(0) 人氣()

 
花了兩週時間搞懂 ......大約的架構與操作

echochio 發表在 痞客邦 留言(0) 人氣()

之前寫的 ....現在放到 git ....紀錄一下
https://github.com/echochio-tw/multicast_mreciver_to_msend

echochio 發表在 痞客邦 留言(0) 人氣()


在主機上寫個 Script 利用排程每五分鐘 判斷 gateway 192.168.0.1 是否可以 ping 到 google 不可以就換 gateway 192.168.0.2 且發信告知
當切換到  192.168.0.2 後 , 下次過 5 分鐘再判斷看看 gateway 192.168.0.1 是否恢復 , 恢復就切回 192.168.0.1 且寄信通知 ....
亂寫就用一條龍寫法 ...不寫副程式了 ....
'判斷是否是 Administrator 權限 , 不是Admin 將切換 ... 切換時可能會問 (Y/N)
If Not WScript.Arguments.Named.Exists("elevate") Then
  CreateObject("Shell.Application").ShellExecute WScript.FullName _
    , """" & WScript.ScriptFullName & """ /elevate", "", "runas", 1
  WScript.Quit
End If
'取得 strDefaultIPGateway 
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each objNetAdapter in colNetAdapters
    If Not isNull(objNetAdapter.DefaultIPGateway) Then
    strDefaultIPGateway = Join(objNetAdapter.DefaultIPGateway, ",")
    End If 
Next
'設定檢查 hostname
 Dim hostname
 hostname = "www.google.com"
 '判斷 是否 gateway 是否是 192.168.0.2
if strDefaultIPGateway = "192.168.0.2" Then
 ' 如 gateway 是 192.168.0.2 就切換到 192.168.0.1
 Set WshShell3 = WScript.CreateObject("WScript.Shell")
 WshShell3.currentdirectory="c:\"
 WshShell3.Run "route change 0.0.0.0 mask 0.0.0.0 192.168.0.1", 0
 Set WshShell3 = Nothing
 ' 用 gateway 192.168.0.1 ping google
 Set WshShell = WScript.CreateObject("WScript.Shell")
 Ping = WshShell.Run("ping -n 1 " & hostname, 0, True)
 Select Case Ping
 
 ' 當 ping 到 google 寄信通知已切換回來 gateway 192.168.0.1
 Case 0
  Set CDOMail = CreateObject("CDO.Message")
    With CDOMail
        .Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") =2
        .Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "192.168.0.3"
        .Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "echochio"
        .Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "echochiopassord"
        .Configuration.Fields.Update
        .From = "echochio@test.com"
        .To = "echochio@test.com"
        .Subject = "Back to gateway to 192.168.0.1"
        .TextBody = "ping www.google.com.tw OK !! Back to gateway to 192.168.0.1"
        .Send
    End With
    Set CDOMail = Nothing
 ' 當 ping 不到 google 切換回去原本的 gateway 192.168.0.2
 Case 1 
  Set WshShell2 = WScript.CreateObject("WScript.Shell")
  WshShell2.currentdirectory="c:\"
  WshShell2.Run "route change 0.0.0.0 mask 0.0.0.0 192.168.0.2", 0
  Set WshShell2 = Nothing
 End Select
' 如 gateway 不是 192.168.0.2 所以是 192.168.0.1 , ping google
Else 
 Set WshShell = WScript.CreateObject("WScript.Shell")
 Ping = WshShell.Run("ping -n 1 " & hostname, 0, True)
 Select Case Ping
 
 '當 ping 不到 google 切換去 192.168.0.2 且寄信通知
 Case 1
  Set WshShell2 = WScript.CreateObject("WScript.Shell")
  WshShell2.currentdirectory="c:\"
  WshShell2.Run "route change 0.0.0.0 mask 0.0.0.0 192.168.0.2", 0
  Set WshShell2 = Nothing
  
  '寄信通知 切換到 192.168.0.2 了
  Set CDOMail = CreateObject("CDO.Message")
    With CDOMail
        .Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") =2
        .Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "192.168.0.3"
        .Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "echochio"
        .Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "echochiopassword"
        .Configuration.Fields.Update
        .From = "echochio@test.com"
        .To = "echochio@test.com"
        .Subject = "defult gateway cannot to google"
        .TextBody = "ping www.google.com.tw fail !! Change gateway to 192.168.0.2"
        .Send
    End With
    Set CDOMail = Nothing
 End Select
End If

echochio 發表在 痞客邦 留言(0) 人氣()


公司ROS內網是 192.168.0.X pptp 進入後得到的 IP 是 192.168.119.X
外網是 WAN1 
公司ROS 設定如下 :

echochio 發表在 痞客邦 留言(0) 人氣()


紀錄一下還真不太會使用 ,  發現會寄信通知 還可以 ....
先設定  projecttype

echochio 發表在 痞客邦 留言(0) 人氣()


用 Teamviewer 回到家發現出現 ....
原來遠端桌面是不可以中斷或縮小的 .....挖哩 .....要將 Teamviewer 安裝成服務 ....
Teamviewer 是廠商提供的 ...且只有錄色版 ....免安裝的被控端企業板

echochio 發表在 痞客邦 留言(0) 人氣()


網路上翻到的 叫做 "信呼" ... 使用 起來還可以 ...有手機的 app  .... 把它繁體化 ...(還沒改完)
紀錄一下 .... 
http://www.rockoa.com/

echochio 發表在 痞客邦 留言(0) 人氣()


紀錄一下 html 的 table 寫法
<table border="1" cellpadding="5" style="border:2px #00DBDB solid;text-align:center;">
<tr>
<td>表格欄位 1 </td>
<td>表格欄位 2 </td>
</tr>
<tr>
 <td colspan=2> 使用 colspan 欄位</td>
</tr>
<tr>
 <td>表格欄位 3 </td>
 <td rowspan="2">使用 rowspan 的欄位</td>
</tr>
<tr>
 <td>表格欄位 4 </td>
</tr>
</table>

echochio 發表在 痞客邦 留言(0) 人氣()

清理 印表機 queue
net stop spooler
del /Q /F /S "%windir%\System32\spool\PRINTERS\*.*"
net start spooler

echochio 發表在 痞客邦 留言(0) 人氣()

定時刪除檔案
for /d %%x in (z:\*) do @rd /s /q "%%x"
del /q z:\*

echochio 發表在 痞客邦 留言(0) 人氣()

百度地圖標示地點
<!DOCTYPE html>
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
        <style type="text/css">
                body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
        </style>
        <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ZUONbpqGBsYGXNIYHicvbAbM"></script>
        <title>带文字标签的覆盖物</title>
</head>
<body>
        <div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
        // 百度地图API功能
        var map = new BMap.Map("allmap");
        var point = new BMap.Point(116.400244,39.92556);
        map.centerAndZoom(point, 18);
        var marker = new BMap.Marker(point);  // 创建标注
        map.addOverlay(marker);              // 将标注添加到地图中
        var label = new BMap.Label("公司",{offset:new BMap.Size(20,-10)});
        marker.setLabel(label);
  // 添加带有定位的导航控件
  var navigationControl = new BMap.NavigationControl({
    // 靠左上角位置
    anchor: BMAP_ANCHOR_TOP_LEFT,
    // LARGE类型
    type: BMAP_NAVIGATION_CONTROL_LARGE,
    // 启用显示定位
    enableGeolocation: true
  });
  map.addControl(navigationControl);
  // 添加定位控件
  var geolocationControl = new BMap.GeolocationControl();
  geolocationControl.addEventListener("locationSuccess", function(e){
    // 定位成功事件
    var address = '';
    address += e.addressComponent.province;
    address += e.addressComponent.city;
    address += e.addressComponent.district;
    address += e.addressComponent.street;
    address += e.addressComponent.streetNumber;
    alert("当前定位地址为:" + address);
  });
  geolocationControl.addEventListener("locationError",function(e){
    // 定位失败事件
    alert(e.message);
  });
  map.addControl(geolocationControl);
</script>

echochio 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。