由於大家很懶,都不想用登入系統的方式查詢ERP,所以想要做個人化真是有點困難。後來魚魚找了些方法來看能不能以抓IP的方式來判斷不同的user,雖說用ServerVariables之類的函數似乎也不賴,但是在虛擬IP下面就完全失效了。
因為我們是透過QoS出去,和Server分屬不同的線路,所以用該函數怎麼抓就是抓到QoS的IP orz
所以乾脆讓客戶端執行ipconfig再撈資料好了! 於是就有下面這篇的產生~
命名空間:System.IO & System
Dim Pinfo As Diagnostics.ProcessStartInfo = New Diagnostics.ProcessStartInfo
Pinfo.Arguments = " /all"
Pinfo.FileName = "ipconfig.exe"
Pinfo.UseShellExecute = False
Pinfo.RedirectStandardInput = True
Pinfo.RedirectStandardOutput = True
Dim Process As Diagnostics.Process = New Diagnostics.Process
Process.StartInfo = Pinfo
Process.Start()
Dim output As StreamReader = Process.StandardOutput
While (output .Read() >= 0)
Label1.Text += output .ReadLine() + "<br>"
End While
Process.Dispose()
不過用這個方法還是沒達成我的要求就是 (啜泣
想知道為什麼,就自己試看看吧!
