Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. You cannot use a Messagebox that way in a service - a windows service runs on a different desktop to the logged on user and that is where it would display things (apart from the fact there is nobody to view them). If you replace the messagebox call with a call to EventLog.WriteEntry instead and see if the message gets written to the log. Does the sqlguardian.exe seem to be getting started - even if only briefly?
  2. Everyone has to start somewhere so I really wouldn't worry about it. Regarding the difference between integers and strings - you will need to convert the values something like the following should work Private Sub Timer2_Tick_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick Dim x As Integer = Integer.Parse(txtN.Text) Dim n As Integer = 1 txtH.Text = n.ToString If n < x Then n = n + 1 'send keys commands are here Timer2.Enabled = False Timer3.Enabled = True txtH.Text = n.ToString Else Timer2.Enabled = False Timer3.Enabled = False End If End Sub Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick Dim ID As Integer = Integer.Parse(txtID.Text) Dim web As System.Uri = New System.Uri("urlhere" & ID.ToString()) Me.WebBrowser1.Navigate(web) Timer3.Enabled = False Timer2.Enabled = True End Sub If you need to access a variable from more than one routine you can declare it at the form (or class) level - this means it should be available to any routine in the same form (or class). Private _number As Integer Private Sub Timer2_Tick_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick Dim x As Integer = Integer.Parse(txtN.Text) Dim n As Integer = 1 _number = n If n < x Then n = n + 1 'send keys commands are here Timer2.Enabled = False Timer3.Enabled = True _number = n Else Timer2.Enabled = False Timer3.Enabled = False End If End Sub Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick Dim ID As Integer = Integer.Parse(txtID.Text) Dim web As System.Uri = New System.Uri("urlhere" & ID.ToString()) Me.WebBrowser1.Navigate(web) Timer3.Enabled = False Timer2.Enabled = True End Sub You could potentially remove an unneeded variable this way giving something like... Private _number As Integer Private Sub Timer2_Tick_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick Dim x As Integer = Integer.Parse(txtN.Text) _number = 1 If _number < x Then _number = _number + 1 'send keys commands are here Timer2.Enabled = False Timer3.Enabled = True Else Timer2.Enabled = False Timer3.Enabled = False End If End Sub Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick Dim ID As Integer = Integer.Parse(txtID.Text) Dim web As System.Uri = New System.Uri("urlhere" & ID.ToString()) Me.WebBrowser1.Navigate(web) Timer3.Enabled = False Timer2.Enabled = True End Sub
  3. The rectangle has MouseEnter / MouseLeave events, these will let you know if the mouse is over the rectangle.
  4. It looks as though that should populate the SampleBuffer with the data for the bitmap. From the documentation it looks as though the Data() is simply each byte of the image - not sure what the byte values mean though.... EDIT: If it is a DIB (which the pdf seems to indicate) then http://www.codeproject.com/KB/GDI-plus/DIBtoBitmap.aspx is probably worth a read as it should get the image into a BMP and from there you can do whatever you want with it.
  5. Out of interest what kind of data are you storing in this file? Just curios as things like Chr(0), Chr(1) etc. are generally taken to have special meanings.
  6. Are you getting any exceptions raised in your code? If so there is a chance the two .Dispose calls at the end of your post are not being called. You might want to move them into a Finally block e.g. Try client.Send(mail) Return True 'Succes Catch ex As Exception 'rest of error handler Finally pdf_stream.Dispose() mail.Dispose() End Try and see if that makes a difference. You may also find that creating a single instance of the SmtpClient and using for all the mail rather than creating a new one per e-mail might keep the overheads down.
  7. Do you want the tooltip to appear if the cursor is over the general area of the words or exactly in a point for a letter? If you are just after the general area could you not put a rectangle over the words and put the tooltip on the rectangle?
  8. What is generating the file? Are you sure it is UTF-8 if it is containing invalid characters? Just as an aside I would declare the variable data as a String rather than Object in your sample as ReadToEnd returns a string.
  9. Is your application talking direct to the SMTP server? If so the error code / message will be sent in response to your RCPT TO: or similar.
  10. http://www.xtremedotnettalk.com/showthread.php?p=463520#post463520 might be useful then.
  11. sql = "SELECT * FROM UserInfo WHERE [userID] ='" & Trim(UsernameTextBox.Text) & "'" would do the trick, however be aware that concatenating strings like that can cause other problems (including security risks), you would be much better off using a parameterised query instead.
  12. What code are you currently using to query the database?
  13. You could replace the core routine with something like UInt32 workingByte = 0x0; UInt64 sum = 0x0; for (Int32 x = 0; x < Bytes.GetUpperBound(0); x += 2) { if (BigEndian) workingByte = ((uint)Bytes[x + 1] << 8) + Bytes[x]; else // little endian, no swap workingByte = ((uint)Bytes[x] << 8) + Bytes[x+1]; sum += workingByte; } return sum; note that you are returning a 64 bit value but only dealing with the bottom 32 bits so direct comparisons might fail - casting the result to a 32 bit value should sort that out though.
  14. You beat me to it... Testing your new routine though doesn't seem to give the same result as your original post, am I missing something? Also if speed is an issue you should probably avoid string operations and use bitwise calculations - will be far more efficient code.
  15. Does the documentation that comes (Assuming any did) indicate what format the data is returned in? Without knowing a bit more about the actual data returned it is going to be difficult to know what to do with the data to get any image format. IIRC the .Net Image classes expect the data to be one of a limited number of formats - if this function isn't returning the data in one of these you will get problems. Is the file at http://www.acs.com.hk/download/API_AET60.pdf the documentation for this device / library? If so it seems to indicate the format of the AET60_BITMAP structure in section 1.3.2. Is that correct?
  16. What image format is the data in the byte array?
  17. How are you loading the data into the control in question?
  18. Does the error contain any other information? Does the function return the image as a jpeg?
  19. What kind of signal does the decoder send? Is it just using UDP or some other mechanism? Is there any documentation with the decoder about how it's networking works?
  20. One thing to be careful with though is the fact than on XP or later only administrators will have permissions to write to the Program Files folder (I'm assuming that is where your application is being installed) so for non-admins this technique might not work. On Vista or later there is a good chance the end user will be annoyed by UAC prompts even if they are admins every time they run this app.
  21. Did you try it with a dll though?
  22. http://www.xtremedotnettalk.com/showthread.php?t=83574 might be enough to get you started.
  23. Are you looking at creating a single executable that will run on all versions of .Net or multiple versions of the executable?
  24. Do you need to actually interact with the webpage or the results or could you not just do a direct post to the target url and read the response via something like the WebClient class?
  25. Just to check - are you wanting to treat the data as 16 bit values rather than 8 bit values?
×
×
  • Create New...