Aug
06
2009
0

ติดต่อ webservice ด้วย proxy

636 views

ตัวอย่างการดึงราคาน้ำมันจาก http://www.pttplc.com/pttinfo.asmx?wsdl
ขั้นแรก add Web References ก่อน

 
        Try
            Dim strReturn As String
            Dim WsPTT As New PTTInfo.PTTInfo()
 
            Dim cr As New System.Net.NetworkCredential("user", "pass", "mydomain")
            Dim pr As New System.Net.WebProxy("203.x.x.x", 8080)
 
            pr.Credentials = cr
            WsPTT.Proxy = pr
 
            strReturn = WsPTT.GetOilPrice("English", 6, 8, 2009)
            MessageBox.Show(strReturn)
 
        Catch Ex As System.Exception
            MessageBox.Show("Time Out")
        End Try
 

Written by Pipo in: VB.Net & Aspx | Tags: , , ,
May
13
2008
0

aspx getSessionId

652 views
Public Function getSessionId () As String
	return System.Web.HttpContext.Current.Session.SessionID
End Functio

Written by Pipo in: VB.Net & Aspx | Tags: ,
Apr
08
2008
0

XmlDocument

522 views
Dim myXmlDoc As XmlDocument = New XmlDocument()
'myXmlDoc.LoadXml(strXml) ' load from string
'myXmlDoc.Load(Server.MapPath("path/to/xml.xml"))
myXmlDoc.Load("http://domain/xml.xml")
Dim UserIdNode As XmlNodeList	=	myXmlDoc.GetElementsByTagName("UserId")
Dim FirstNameNode As XmlNodeList	=	myXmlDoc.GetElementsByTagName("FirstName")
 
Dim UserId As String	=	Convert.ToString(UserIdNode(0).InnerText)
Dim FirstName As String	=	Convert.ToString(FirstNameNode(0).InnerText)

(more...)

Written by Pipo in: VB.Net & Aspx | Tags:
Apr
03
2008
0

To enable/disable Just-In-Time debugging

1,978 views

Dr. Watson

start->run->cmd enter
drwtsn32.exe -i

Visual Studio

  1. On the Tools menu, click Options.
  2. In the Options dialog box, select the Debugging folder.
  3. In the Debugging folder, select the Just-In-Time page.
  4. In the Enable Just-In-Time debugging of these types of code box, select or clear the relevant program types: Managed, Native, or Script.To disable Just-In-Time debugging, once it has been enabled, you must be running with Administrator privileges. Enabling Just-In-Time debugging sets a registry key, and Administrator privileges are required to change that key.
  5. Click OK.

Written by Pipo in: VB.Net & Aspx | Tags:
Mar
21
2008
0

WebClient

969 views
 
<%
Dim colParameter As New System.Collections.Specialized.NameValueCollection
colParameter.Add("a", "aaaaaaaaa")
colParameter.Add("b", "bbbbbbbbb")
 
Dim objClient As Net.WebClient = New System.Net.WebClient
Dim bytReponse As Byte() = objClient.UploadValues("http://domain.com/path/to/script", "POST",colParameter)
Dim strWebPage As String = Encoding.ASCII.GetChars(bytReponse)
 
Response.Write(strWebPage)
%>
 

Written by Pipo in: VB.Net & Aspx | Tags:
Feb
01
2008
4

วิธีแก้ไข Server Application Unavailable IIS + .NET Framework 2

4,855 views

สำหรับคนที่ใช้ IIS ทดสอบงานกับ .NET Framework 2 นั้นอาจจะต้องเจอปัญหาแบบนี้
เนื่องจาก IIS ยังไม่รู้จักกับ .NET Framework 2 ซึ่งขั้นตอนการแก้ไขก็เพียงแต่ทำให้ IIS รู้จักกับ .NET Framework 2 เท่านั้นเอง
(more...)

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes