Jump to content
Xtreme .Net Talk

Mondeo

Avatar/Signature
  • Posts

    128
  • Joined

  • Last visited

Everything posted by Mondeo

  1. Hi, My visual studio crashed today and I had to restart the pc, now the project I was working on just wont compile. I get the following errors Error 1 The item "obj\Debug\eMatrixAdminSystem.frmMainLayout.resources" was specified more than once in the "Resources" parameter. Duplicate items are not supported by the "Resources" parameter. Error 104 'Private Sub InitializeComponent()' has multiple definitions with identical signatures. How can I fix this, i've looked in the designer section of my form and the InitializeComponent method is only there once. Hope someone can help. Thanks
  2. A couple of ways spring to mind. 1. Change the line to <body style="background-image:url('<%=myImage%>')"> Then in your code behind Public myImage as String Private Sub Page_Load etc myImage = "renew_bkgrd2.jpg" End Sub A better way it to use a literal control. Put an ASP.NET Literal control in place of that line, then in your code behind you just need Literal1.Text = "<body style=""background-image:url('renew_bkgrd2.jpg')"">" Hope that helps
  3. If I had 3 webbrowsers on a form and the following code. Would all three webbrowsers do their navigation to the 3 pages at the same time, and present the results at roughly the same time? As if for example they were on seperate threads? Thanks Dim Browser1State as Int16 = 1 Dim Browser2State as Int16 = 1 Dim Browser3State as Int16 = 1 Sub Form_Load WebBrowser1.Navigate("www.site1.com/login.aspx") WebBrowser2.Navigate("www.site2.com/login.aspx") WebBrowser3.Naviagte("www.site3.com/login.aspx") End Sub Sub WebBrowser1.DocumentCompleted Select Case Browser1State Case 1 Browser1State = 2 'Enter the login details and click the submit button Case 2 Browser1State = 3 'Enter parameters on page 2 and click submit Case 3 'Scrape some information off the results page End Sub Sub WebBrowser2.DocumentCompleted Select Case Browser2State Case 1 Browser2State = 2 'Enter the login details and click the submit button Case 2 Browser2State = 3 'Enter parameters on page 2 and click submit Case 3 'Scrape some information off the results page End Sub Sub WebBrowser3.DocumentCompleted Select Case Browser3State Case 1 Browser3State = 2 'Enter the login details and click the submit button Case 2 Browser3State = 3 'Enter parameters on page 2 and click submit Case 3 'Scrape some information off the results page End Sub Thanks
  4. I would parse the csv file using a streamreader and use the readline method with string.split(",") to build the datatable manually.
  5. Is there a better option? I thought earlier about having 7 web services which all create an indidivual instance of the browser, perform the manipulation and then return the result. Then in my forms app I could simply call the individual web services on different threads. Would that work okay do you think? Thanks
  6. Does anyone know how to instantiate/initialize an active x control in a windows forms app in code. In particular the ax web browser control. It works fine just dropping it onto the form, but I want to create it from scratch in a seperate thread to the UI, I can create it and it appears on the form however when I call its navigate method I get this Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was unhandled Thanks
  7. Hi PD, I'm manipulating the controls of each web page inside a web browser control. Basic Example: Private Function GetCurrentWebDoc() As mshtml.HTMLDocument Try Return DirectCast(wb.Document, mshtml.HTMLDocument) Catch ex As Exception Return Nothing End Try End Function Private Function GetCurrentWebForm() As mshtml.HTMLFormElement Try If GetCurrentWebDoc.forms.length > 0 Then Return DirectCast(GetCurrentWebDoc.forms.item(0), mshtml.HTMLFormElement) Else Return Nothing End If Catch ex As Exception Return Nothing End Try End Function Private Sub SetTextareaText(ByVal Text As String) DirectCast(GetCurrentWebForm.item("txtArea"), mshtml.HTMLTextAreaElement).value = Text End Sub Private Sub ClickNormalButton() DirectCast(GetCurrentWebForm.item("cmdClickMe", 0), mshtml.HTMLButtonElement).click() End Sub I was thinking about having 7 web browser controls, all invisible which are manipulated on 7 threads with the results being returned as they complete to the UI thread. Is this the correct approach do you think? Thanks
  8. I've been given a project that i'm about to start. Its basic function is to connect to 6 or 7 websites, fill out some form data and then scape some information from the results pages and display it to the user. Its for price comparison, similar to confused.com. Each site it connects to takes about 30 seconds to get to the results, so I was hoping to connect them all concurrently on seperate threads. There will be seven different functions which all return the same custom object. Can I call these functions on different threads? How would I go about it? Thanks
  9. There's an aspx web page which contains 3 dropdownlists and an image button, the dropdownlists are cascading so you select something in the first, then the second, then the third. Then the imagebutton is clicked. I need to try and interact with this webpage behind the scenes in code, can I do it somehow with WebRequest and WebResponse. I need to make a selection in the first drop down (and cause the associated postback) then the second, then the third, then "click" the imagebutton. On the resulting page is some data that I need to parse out. Can it be done? Any pointers appreciated.
  10. Hi, Got an enumeration which i've iterated through and added its members to a combobox. Dim s As New Nevron.UI.WinForm.Controls.ColorScheme Dim schemes As Array schemes = system.Enum.GetValues(GetType(Nevron.UI.WinForm.Controls.ColorScheme)) Dim scheme As Nevron.UI.WinForm.Controls.ColorScheme For Each scheme In schemes cboPalletteSelect.Items.Add(scheme) Next When the user selects a scheme I need to store the integer value of the enum in my database, but how do I access it? cboPalletteSelect.SelectedItem only returns a string, how to I get the underlying index of the selected enum? Thanks
  11. Sorry Amir, I dont follow you? Thanks
  12. I have an ASP.NET button click event. I want to do some validation and then if theres a problem display a javascript alert messagebox and exit the sub. I've got this working but the page posts back first and I get a blank screen with the alert box on, when I click OK the page loads. How can I throw up this alert box without causing a postback? Is it possible? Thanks
  13. Managed to get them talking to each other by installing a new protocol on the XP machine - Link Layer Topology Discovery Responder. But now a new error when I try and connect to the printer "Windows cannot connect to the printer. The server print spooler service is not running. Please restart the spooler on the server or restart the server machine." Its rubbish, the spooler service on the XP machine is running fine and I can print no problem from other non Vista PC's I've only managed to find a handful of references to this error (like the one below) and no solution. http://www.vistax64.com/vista-networking-sharing/19061-spooler-network-printer-problem.html Any ideas? Cheers
  14. Spot on. If I reverse the month and day it works fine. SqlClient must split the string up and pass the values individually, perhaps as parameters. Thanks a lot
  15. Hi, I'm trying to access the onClick of an image to run some javascript when the image is clicked. document.getElementByID('imgMain').onClick = 'window.close' But it throws an error. Microsoft JScript runtime error: Object doesn't support this property or method Can this be done, if so whats the correct syntax? Many Thanks
  16. Originally I was just building the string with concatenation, but for this example I just put it directly into a string Dim sql as string = "SELECT * FROM vwAllMatrixVehicles WHERE created >= '2007/8/9'" Its very puzzling???
  17. I have this statement SELECT * FROM vwAllMatrixVehicles WHERE created >= '2007/8/9' Using query analyser in sql management studio it returns about 80 rows. Trying to use it in ASP.NET with the SqlCommand class the same statement returns 0 rows. I've double checked my code, its fine. If I replace the select statement with something else that doesn't use a date its fine. Does SqlClient handle dates differently somehow? Thanks
  18. This drove me nuts earlier, my first real experience with Vista. I have a Windows XP machine with a shared printer, the sharename is \\computer1\hpoffice. Ip address of machine 192.168.2.3 I have a Windoes Vista machine called computer 2 with IP 192.168.2.2 I can ping between the machines fine. I'm trying to access the printer from the Vista machine, tried using the standard add printer, network printer, share name. Tried both using the UNC path \\computer1\hpoffice and also by ip \\192.168.2.3\hpoffice. The error message was - the network path could not be found. Both machines are in the same workgroup. Cannot browse to the XP one whatsoever, again - the network path could not be found. What am i missing? Cheers
  19. The server is Microsoft Exchange 2000. Do you know if this has the feature you mentioned? Thanks
  20. I'm considering building an application which will send SMS text messages from an email. For example someone could send to +44252666783@sms.mydomain.com I also need to recieve normal smtp email through the same connection which this application would use. So i'm thinking something like this would work. 1. My application listens on port 25 for all incoming messages 2. When message comes in it checks for "sms" in the to address. If its there it processes the sms message 3. If not then it assumes its a normal smtp message and relays to the mail server which will listen on port 26 I understand how I want it to work, I just wondered if anyone had any experience with the SMTP protocol, is it easy to implement. All i'll need to do is read the TO: addresss and then, worst case scenario relay the orginal message on. Thanks
  21. Hi, I have a combobox on a form, I noticed that unlike the dropdownlist in asp.net which has a collection of ListItems the combobox can hold any object. So I created a ListItem class to use. Public Class ListItem Dim _text, _value As String Property Text() As String Get Text = _text End Get Set(ByVal val As String) _text = val End Set End Property Property Value() As String Get Value = _value End Get Set(ByVal val As String) _value = val End Set End Property Sub New(ByVal inText As String, ByVal inValue As String) Me.Text = inText Me.Value = inValue End Sub Public Overrides Function ToString() As String Return Me.Text End Function End Class Then I added items to the combobox like this Dim li as new listitem("My Text","My Value") cboDealers.Items.Add(li) I want to bind the value of the combobox to a datasource using Databindings.Add, but which property contains the value, is it a property of the listitem class I need to use or the combobox itself? Thanks
  22. I've got a tabcontrol within a tabcontrol, it has 4 tabs which all contain controls that i'm databinding to, for example chkLive.Databindings.Add("checked",currentVehicle,"isLive") This all works fine apart from the databinding doesn't seem to happen until you click on each individual tab. I have a button to do something based on the value of one of the databound checkboxes, but its value is always false unless I click on that individual tab first, in which case it changes to true. I've tried this to solve the problem ' workaround for databinding to child tabs bug For Each tab As TabPage In tabControlMarketingDetails.TabPages tabControlMarketingDetails.SelectTab(tab) Next tabControlMarketingDetails.SelectTab(0) But its still the same. Whats the best way around this? Thanks
  23. I have a page index.aspx which contains a user control, the user control is a search module and has drop downs for the search criteria, it also has a search button. When the button is pressed it calls reponse.redirect to a search results page. Is there anyway I can preserve the values of the dropdowns on the user control between different pages? Thanks
  24. Hi Nate, I'm not sure if thats a yes or a no lol. You say you dont think its possible but then you said that the extension can be anything as long as its running on an asp.net server (which it is) Are you saying that whatever the extension the asp.net engine will read the header of the page and process any script automatically? Sorry for being confused!
  25. Hi, Is there anyway to use ASP.NET runat=server code within a page with a standard .html extension. I just wondered becuase i've got a small job to do on 1 page on a plain html site and i'd like to keep all the page extensions consistant. (its just a contact us form) Thanks
×
×
  • Create New...