
pinster
Avatar/Signature-
Posts
29 -
Joined
-
Last visited
About pinster
- Birthday 07/12/1982
Personal Information
-
Occupation
Software Developer
pinster's Achievements
Newbie (1/14)
0
Reputation
-
Hi, I'm working on a tool that can trace the flow of methods being called for debugging purposes. I'm trying to use Profiler APIs to hook into methods calling events to capture the flow instead of using the Diagnostic classes like StackTrace or StackFrame which requires me to write codes into the target applications and re-compile. My problem is that I'm quite new in using Profiler API in VB.NET/C#. Anyone have experience before? Your help is very much appreciated! Thanks!
-
Calling a stored procedure from another stored procedure
pinster replied to mike55's topic in Database / XML / Reporting
Yes, it's possible. Just exec the SP as you would normally. -
Recently, I found out something call 'smart document' for office 2003 (particularly MS Word). It's based on XML schema (XSD). I'm interested to learn more about this and appreciate if someone will point me the right direction for more information on how to program it in vb.net. Thanks.
-
Yeah! I figured it out now! I was using HTTPWatch to see what was sent and received in a browser, then discovered that it was cookies problem. Thanks!
-
Hi, I remember the old days, we can do form posting using INET or Winsock. Switching to ASP.NET, the server-side form is working in a different way... eg. post back, view state, etc. I'm trying to programatically login to the website, http://mawar.www.gov.my/eGA.NET/aca.aspx?Target=UserMain&LANG=1 but I'm not getting the desire result page although i had submitted the correct username and password... My code goes like this: (It's a custom control which is used in a web form) Dim _ResponseData As String, _ViewState As String Dim _FormParam As String, oWebRequest As HttpWebRequest, oWebResponse As HttpWebResponse Dim ResponseReader As StreamReader, RequestWriter As StreamWriter Dim cookies As New CookieContainer, _target As String Dim _EventTarget As String, _EventArg As String 'Download HTML oWebRequest = HttpWebRequest.Create("http://mawar.www.gov.my/eGA.NET/aca.aspx?Target=UserMain&LANG=1") ResponseReader = New StreamReader(oWebRequest.GetResponse.GetResponseStream) _ResponseData = ResponseReader.ReadToEnd ResponseReader.Close() 'Extract ViewState _ResponseData = _ResponseData.Replace("name=""__VIEWSTATE"" value=""", "~") '_ViewState = _ResponseData.Substring(_ResponseData.IndexOf("~") + 1, (_ResponseData.IndexOf(""" />", _ResponseData.IndexOf("~")) - 1) - _ResponseData.IndexOf("~")) _ViewState = Web.HttpUtility.UrlEncodeUnicode(_ResponseData.Substring(_ResponseData.IndexOf("~") + 1, (_ResponseData.IndexOf(""" />", _ResponseData.IndexOf("~")) - 1) - _ResponseData.IndexOf("~"))) _target = "Login" _EventTarget = "" _EventArg = "" _FormParam = String.Format("target={0}&__EVENTTARGET={1}&__EVENTARGUMENT={2}&__VIEWSTATE={3}&txtUser={4}&txtPassword={5}", _target, _EventTarget, _EventArg, _ViewState, "user", "pwd") oWebRequest = HttpWebRequest.Create("http://mawar.www.gov.my/eGA.NET/aca.aspx?target=Login&p=http://mawar.www.gov.my/eGA.NET/aca.aspx?target=UserMain") oWebRequest.Method = "POST" oWebRequest.ContentType = "application/x-www-form-urlencoded" oWebRequest.ContentLength = _FormParam.Length 'oWebRequest.CookieContainer = cookies RequestWriter = New StreamWriter(oWebRequest.GetRequestStream) RequestWriter.Write(_FormParam) RequestWriter.Close() 'oWebRequest.GetResponse.Close() oWebResponse = oWebRequest.GetResponse 'HttpWebRequest.Create("http://mawar.www.gov.my/eGA.NET/aca.aspx?Target=UserMain&LANG=1") 'oWebRequest.CookieContainer = cookies ResponseReader = New StreamReader(oWebResponse.GetResponseStream) _text = ResponseReader.ReadToEnd ResponseReader.Close() Basically, I'm requesting for the login.aspx, get the viewstate, post my username and password, then get the protected page. In this example, if it's login failed, we should get back to the same login page with an error message 'Invalid Login. Please enter a valid User Name and Password'. Otherwise, if successful, we should get to another page with the word 'My Profile' inside the page. I'm really stucked with this.. I hope there is any expert who can help or guide me. Thank you!
-
Can you illustrate more about the problem? As far as i know, each session maintain it's own timer that checks for its respective timeout threshold.
-
Oh guys, I solved the problem. I should have save the contents as XML document with each component's text as seperate XML element. Thanks.
-
What about casting your object to an arraylist? CType(Object,ArrayList)
-
You can use either 'Windows' or 'Form' based authentication method. All you have to do is to change this option in the web.config file. If you are using 'Windows' then you will manage the site users account with windows, otherwise if you use 'Form' then you must create a form for login and maintain the site users account in your mysql database.
-
Hi, I'm trying to create a custom placeholder control for MS Content Management Server 2002. I encounter an error as below: Save Placeholder Failed ---------------------------------------------------------- Error Details: The data at the root level is invalid. Line 1, position 1. The custom placeholder implementation is as below: Imports System.Xml Imports System.Xml.Xsl Imports System.Web.UI.WebControls Imports Microsoft.ContentManagement.Publishing Imports Microsoft.ContentManagement.Publishing.Extensions.Placeholders Imports Microsoft.ContentManagement.WebControls.Design Imports Microsoft.ContentManagement.WebControls Public Class XMLPlaceholderControl Inherits BasePlaceholderControl Private HeaderText As New TextBox Private HeaderLink As New HyperLink Private BodyText As New TextBox Private BodyLabel As New Label Private lit As Literal Protected Overrides Sub CreateAuthoringChildControls(ByVal authoringContainer As Microsoft.ContentManagement.WebControls.BaseModeContainer) lit = New Literal lit.Text = "<table border=0 cellspacing=0 cellpadding=0 width=50%><tr id=headTR valign=top><td width=100% align=left>" authoringContainer.Controls.Add(Me.lit) With Me.HeaderText .ID = "txtHead" .Width = Unit.Percentage(100) End With authoringContainer.Controls.Add(Me.HeaderText) lit = New Literal lit.Text = "</td></tr><tr id=bodyTR valign=top><td width=100% align=left>" authoringContainer.Controls.Add(Me.lit) With BodyText .ID = "txtBody" .TextMode = TextBoxMode.MultiLine .Rows = 5 .Wrap = True .Width = Unit.Percentage(100) End With authoringContainer.Controls.Add(Me.BodyText) lit = New Literal lit.Text = "</td></tr></table>" authoringContainer.Controls.Add(Me.lit) End Sub Protected Overrides Sub CreatePresentationChildControls(ByVal presentationContainer As Microsoft.ContentManagement.WebControls.BaseModeContainer) lit = New Literal With lit .Text = "<script language=""javascript"" src=""classes.js"" type=""text/javascript""></script>" End With presentationContainer.Controls.Add(Me.lit) lit = New Literal lit.Text = "<table border=0 cellspacing=0 cellpadding=0 width=50%><tr id=headTR valign=top><td width=100% align=left>" presentationContainer.Controls.Add(Me.lit) With Me.HeaderLink .ID = "lnkHead" .Width = Unit.Percentage(100) .NavigateUrl = "#" .Attributes("onClick") = "toggle('bodyTR')" .Text = CType(Me.BoundPlaceholder, XmlPlaceholder).XmlAsString End With presentationContainer.Controls.Add(Me.HeaderLink) lit = New Literal lit.Text = "</td></tr><tr id=bodyTR valign=top style=""display:none;""><td width=100% align=left>" presentationContainer.Controls.Add(Me.lit) With BodyLabel .ID = "lblBody" .Width = Unit.Percentage(100) .Text = CType(Me.BoundPlaceholder, XmlPlaceholder).XmlAsString End With presentationContainer.Controls.Add(Me.BodyText) lit = New Literal lit.Text = "</td></tr></table>" presentationContainer.Controls.Add(Me.lit) End Sub Protected Overrides Sub LoadPlaceholderContentForAuthoring(ByVal e As Microsoft.ContentManagement.WebControls.PlaceholderControlEventArgs) Me.EnsureChildControls() Try Me.HeaderText.Text = "-- Title --" Me.BodyText.Text = "-- Description --" Catch ex As Exception Throw (New Exception("Error Loading Authoring Contorls", ex)) End Try End Sub Protected Overrides Sub LoadPlaceholderContentForPresentation(ByVal e As Microsoft.ContentManagement.WebControls.PlaceholderControlEventArgs) Me.EnsureChildControls() Try Me.HeaderLink.Text = CType(Me.BoundPlaceholder, XmlPlaceholder).XmlAsString Me.BodyLabel.Text = CType(Me.BoundPlaceholder, XmlPlaceholder).XmlAsString Catch ex As Exception Me.HeaderLink.Text = "Unable to load text" End Try End Sub Protected Overrides Sub SavePlaceholderContent(ByVal e As Microsoft.ContentManagement.WebControls.PlaceholderControlSaveEventArgs) Me.EnsureChildControls() Try CType(Me.BoundPlaceholder, XmlPlaceholder).XmlAsString = Me.HeaderText.Text CType(Me.BoundPlaceholder, XmlPlaceholder).XmlAsString = Me.BodyText.Text Catch ex As Exception Dim errMsg As String = "Unable to save text" Throw (New Exception(errMsg, ex)) End Try End Sub End Class FYI, this custom placeholder is bind to XMLPlaceholderDefinition. The error occurs when I click on 'Preview' or 'Save New Page'. I suspect something wrong with my SavePlaceholderContent method implementation but I'm not sure how to fix it. Or probably, because I have multiple server controls in this single custom placeholder? Please help me if anyone have experience with MCMS 2002. Thanks!!!
-
Guys, I already found out the answer. We need to add labels to the ValueLabels Collection in AxisX then set the AnnoMethod to use ValueLabels. :)
-
You can do that with a WildCard character by default. For searching in database eg. SELECT ... FROM ... WHERE ... LIKE '%'
-
I'm using ComponentOne WebChart control for drawing chart. The ChartData is based on PointF array. The chart looks like this: http://www.connect2my.net/iats/chart.png My question is, how can I replace the 1, 2, 3 in AxisX with a string label? Thank you for helping! :)
-
I got what you mean!! :D
-
Best of all, they are all FREE!! :)