Advertisement
sergiomartinesc

index.aspx.vb

Nov 14th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.25 KB | None | 0 0
  1. Imports System.Xml
  2.  
  3. Partial Class _Default
  4.  
  5.     Inherits System.Web.UI.Page
  6.  
  7.     Public Function getSession()
  8.  
  9.         Dim mstrSession As String
  10.  
  11.         Const url As String = "http://localhost/Microstrategy/asp/TaskAdmin.aspx?taskId=getSessionState&taskEnv=xml&taskContentType=xml&server=SERVER&project=PROJECT&uid=user&pwd=passwd"
  12.  
  13.         Dim reader As XmlTextReader = New XmlTextReader(url)
  14.         Dim tag As String = ""
  15.  
  16.         Do While (reader.Read())
  17.  
  18.             Select Case reader.NodeType
  19.                 Case XmlNodeType.Element : tag = reader.Name
  20.                 Case XmlNodeType.EndElement : tag = ""
  21.                 Case XmlNodeType.Text
  22.                     If tag = "min-state" Then mstrSession = reader.Value
  23.             End Select
  24.         Loop
  25.  
  26.         Return mstrSession
  27.     End Function
  28.  
  29.     Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
  30.         Response.BufferOutput = True
  31.         Response.Redirect("http://localhost/Microstrategy/asp/Main.aspx?Server=SERVER&Project=PROJECT&Port=0&evt=2048001&src=Main.aspx.2048001&visMode=0&documentID=3A85FC34DDF56F1DF8ADBA22F7D&connmode=8&ru=1&share=1&hiddensections=header,path,dockTop,dockLeft,DockRight,footer&mstrSmgr=" & getSession())
  32.  
  33.     End Sub
  34. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement