
รูปการเปิดสิทธิ์ให้ทำการ Remote Desktop ผ่านเครื่องอื่น


ทำการเพิ่ม User อื่น ที่ไม่ใช่ Admin เข้าไป แค่นี้เราก็จะไม่ตาลายกับ User อื่นที่เราสร้างไว้ และยังป้องกันการเข้าใช้เครื่องผ่าน Userอื่นที่ไม่ใช้adminด้วยคับ
-------------------------------------------------
Imports System.Xml
Imports System.Text
Private filename As String = Application.StartupPath & "\" & "config.xml"
Public str_Servername As String = "ServerName"
Public str_UserName As String = "UserName"
Public str_Password As String = "Password"
Public Sub SetWriteXML(ByVal servername As String, ByVal username As String, ByVal pwd As String)
If Not IO.File.Exists(filename) Then
Dim xmlText = "<?xml version='1.0' encoding='utf-8'?>" & _
"<configuration>" & _
"</configuration>"
Dim xmlDoc As New XmlDocument()
xmlDoc.LoadXml(xmlText)
xmlDoc.Save(filename)
End If
Try
'Create file, overwrite if exists
'enc is encoding object required by constructor
'It is null, so default encoding is used
Dim objXMLTW As New XmlTextWriter(filename, Encoding.UTF8)
With objXMLTW
.IndentChar = vbTab
.Indentation = 1
.Formatting = Formatting.Indented
.WriteStartDocument()
'Top level (Parent element)
.WriteStartElement("configuration")
'Child elements, from request form
.WriteElementString(str_Servername, servername)
.WriteElementString(str_UserName, username)
.WriteElementString(str_Password, pwd)
.WriteEndElement() 'End top level element
.WriteEndDocument() 'End Document
.Flush() 'Write to file
.Close()
End With
Catch Ex As Exception
End Try
End Sub
Public Function GetReadXML(ByVal keyName As String) As String
Dim getvalue As String = ""
Dim XmlDoc As XmlDocument = New XmlDocument()
Try
With XmlDoc
XmlDoc.Load(filename)
getvalue = .SelectSingleNode("configuration/" & keyName).InnerText()
XmlDoc = Nothing
End With
Catch ex As Exception
End Try
Return getvalue
End Function
------------------------------------------------
------------------------------------------------
<system.webServer>
<httpprotocol>
<customheaders>
<clear />
<add name="X-UA-Compatible" value="IE=8" />
</customHeaders>
</httpProtocol>
</system.webServer>
------------------------------------------------
----------------------------------------------------------
Public Function ChangeToThaibathWord(ByVal mondyValue As String) As String
Dim digit() As String = {"เอ็ด", "สิบ", "ร้อย", "พัน", "หมื่น", "แสน", "ล้าน", "สิบล้าน", "ร้อยล้าน", "พันล้าน"}
Dim tmp() As String = mondyValue.Split(".".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
Dim intNumber = tmp(0).Replace(",", "")
Dim decNumber As String
If (tmp.Length > 1) Then
decNumber = tmp(1)
Else
decNumber = ""
End If
Dim result As String = ""
Dim testChar As String = ""
Dim splitChar As String = ""
Dim wordLength As Integer = intNumber.Length - 1
For intPosition As Integer = 0 To wordLength
splitChar = intNumber.Substring(intPosition, 1)
Select Case splitChar
Case "0" : testChar = ""
Case "1" : testChar = "หนึ่ง"
Case "2" : testChar = "สอง"
Case "3" : testChar = "สาม"
Case "4" : testChar = "สี่"
Case "5" : testChar = "ห้า"
Case "6" : testChar = "หก"
Case "7" : testChar = "เจ็ด"
Case "8" : testChar = "แปด"
Case "9" : testChar = "เก้า"
End Select
Select Case (wordLength - intPosition)
Case 0
If (splitChar = "1") Then
If (wordLength = 0) Then
result = result & testChar
Else
result = result & digit(wordLength - intPosition)
End If
Else
result = result & testChar
End If
Case 1
Select Case splitChar
Case "0"
Case "1"
result = result & digit(wordLength - intPosition)
Case "2"
testChar = "ยี่"
result = result & testChar & digit(wordLength - intPosition)
Case Else
result = result & testChar & digit(wordLength - intPosition)
End Select
Case Else
Select Case splitChar
Case "0"
Case Else
result = result & testChar & digit(wordLength - intPosition)
End Select
End Select
Next
result = result & "บาท"
Dim stang As String = ""
If (decNumber.Length > 0) Then
wordLength = decNumber.Length - 1
For intPosition As Integer = 0 To wordLength
splitChar = decNumber.Substring(intPosition, 1)
Select Case splitChar
Case "0" : testChar = ""
Case "1" : testChar = "หนึ่ง"
Case "2" : testChar = "สอง"
Case "3" : testChar = "สาม"
Case "4" : testChar = "สี่"
Case "5" : testChar = "ห้า"
Case "6" : testChar = "หก"
Case "7" : testChar = "เจ็ด"
Case "8" : testChar = "แปด"
Case "9" : testChar = "เก้า"
End Select
Select Case (wordLength - intPosition)
Case 0
If (splitChar = "1") Then
If (wordLength = 0) Then
stang = stang & testChar
Else
stang = stang & digit(wordLength - intPosition)
End If
Else
stang = stang & testChar
End If
Case 1
Select Case splitChar
Case "0"
Case "1"
stang = stang & digit(wordLength - intPosition)
Case "2"
testChar = "ยี่"
stang = stang & testChar & digit(wordLength - intPosition)
Case Else
stang = stang & testChar & digit(wordLength - intPosition)
End Select
Case Else
Select Case splitChar
Case "0"
Case Else
stang = stang & testChar & digit(wordLength - intPosition)
End Select
End Select
Next
End If
If (stang.Trim().Length > 0) Then
stang = stang & "สตางค์"
Else
stang = "ถ้วน"
End If
result = result & stang
Return result
End Function
------------------------------------------------
-------------------------------------------------
<html>
<body>
<script type="text/javascript">
function animateBlink(aa) {
var myTA = document.getElementById(aa);
if (myTA.style.display == '') {
myTA.style.display = 'none';
} else {
myTA.style.display = '';
}
setTimeout("animateBlink('"+aa+"');", 500);
}
setTimeout("animateBlink('data1');", 500);
</script>
<span id="data1">Your text</span>
</body>
</html>
------------------------------------------------