Search:

Type: Posts; User: dbasnett

Page 1 of 13 1 2 3 4

Search: Search took 0.48 seconds.

  1. Replies
    13
    Views
    626

    Re: Randomize Questions and Answers

    A beginning generalized approach for asking questions and answers. You'll need a button and rich textbox to try this.


    Private Shared PRNG As New Random
    Private Qorder As List(Of...
  2. Re: Navigating an XML structure - please help

    I'd use XElement and LINQ.

    The data


    Dim data As XElement
    'to load from site
    ' data=XElement.Load(url to data here)

    'FOR TESTING you can use a literal
  3. Replies
    13
    Views
    330

    VS 2019 Re: [RESOLVED] Check checkbox in a loop

    And... what happened?
  4. Replies
    13
    Views
    330

    VS 2019 Re: [RESOLVED] Check checkbox in a loop

    I know. See edit. ;)
  5. Replies
    13
    Views
    330

    VS 2019 Re: [RESOLVED] Check checkbox in a loop

    Try this


    For Each cntrl As CheckBox In Panel2.Controls.OfType(Of CheckBox)()
    If cntrl.Checked Then

    End If
    Next
  6. Replies
    8
    Views
    284

    Re: If EndIf 4 possibilities

    Just an alternative,


    Dim first2Chars As String = TextBox4.Text.Substring(0, 2)
    Dim TB5val As Integer
    If Integer.TryParse(TextBox5.Text, TB5val) Then
    Select...
  7. VS 2022 Re: Removing the last line carriage from a string

    I missed the part where there might be other trialing white space.
  8. VS 2022 Re: Removing the last line carriage from a string

    Use .TrimEnd


    'refs.
    ' https://docs.microsoft.com/en-us/dotnet/api/system.string.trimend?view=net-6.0#System_String_TrimEnd
    '...
  9. Replies
    8
    Views
    479

    VS 2019 Re: Cancellation of task

    Looking at yours and mine I can see structurally they are not the same.
  10. Replies
    8
    Views
    479

    VS 2019 Re: Cancellation of task

    A short example,



    Private CTSource As New Threading.CancellationTokenSource()
    Private Async Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    ...
  11. VS 2015 Re: The numbers change when I send data from Visual Basic.net to the Arduino

    See Delaneys post. You need to check that there is data before you try and read it.
  12. VS 2015 Re: The numbers change when I send data from Visual Basic.net to the Arduino

    Do you have a Serial.available() before the Serial.parseInt()'s?
    Have you changed the encoding on the VB side?
    Do the bit rates match?
  13. Re: Get device IP-address within auto-ip range (169.254.x.y)

    If this, "The PLC's are never part of a network..." is true then these devices should have a fixed IP address.
  14. Re: convert date timespan with regional time

    I think we all agree that this isn't a standard format. My understanding is that Unix timestamps are time zone independent, they are by definition UTC times.
  15. Re: convert date timespan with regional time

    This produces 2/5/2022


    Dim dtest As DateTime = #1/1/1970#

    dtest = dtest + TimeSpan.FromMilliseconds(1644012000000) + TimeSpan.FromHours(2)
  16. Replies
    44
    Views
    1,605

    Re: Read and write color to xml file

    FWIW - gets all properties of all buttons on a form not in a container.


    Dim buttons As XElement = <buttons>
    </buttons>
    Dim buttonProto As...
  17. VS 2017 Re: How would I complete this recursion algorithm?

    If you are using C# you are in the wrong forum. One of the admins will move this if that is the case.
  18. Replies
    2
    Views
    401

    Re: SQL Server fulltext - Search failures

    If I rebuild and repopulate the problem goes away.
  19. Replies
    2
    Views
    401

    SQL Server fulltext - Search failures

    After four years of working without error our full text searches have been returning results that are incorrect. Sometimes we get fewer matches than expected, sometimes more. Back to back searches...
  20. VS 2013 Re: Object reference not set to an instance of an object.

    Good point! If the code is in the Load event handler the label might not exist.
  21. Replies
    6
    Views
    440

    Re: Detect resize Top/Bottom vs Left/Right?

    It will be something like this,


    Private mySizeBeg As Size 'size at ResizeBegin
    Private mySizeIP As Size 'size during Resize

    Private Sub Form1_ResizeBegin(sender As Object, e As...
  22. Thread: Read XML File

    by dbasnett
    Replies
    4
    Views
    505

    Re: Read XML File

    BASED on what you posted. Note I used a literal for testing.


    Dim xe As XElement
    ' xe = XElement.Load("path here")

    xe = <Part PartNo="2019401001503">
    ...
  23. Re: Delete XML Element/Node if Element/Node equals xxx

    In the future try and do a better job in your initial post.
  24. Re: Delete XML Element/Node if Element/Node equals xxx

    XElement and LINQ


    Dim some As XElement = <Data>

    <ControlledObject>
    <child1 name="name1"/>
    ...
  25. Replies
    7
    Views
    634

    Re: SerialPort Low Level Settings?

    What exactly is 'HART DEVICE'? It is strange that you are using flow control.
  26. Thread: Simple Split

    by dbasnett
    Replies
    6
    Views
    552

    Re: Simple Split

    Here is the reference for .Split which as JMC as pointed out you should be using.
  27. Replies
    13
    Views
    1,042

    VS 2010 Re: Ping Network Computer

    Try it like this

    First a method,

    Private Function PingIt(HostOrIP As String) As Boolean
    Dim rv As Boolean = False
    Try
    Dim _ip As Net.IPAddress
    ...
  28. Replies
    13
    Views
    1,042

    VS 2010 Re: Ping Network Computer

    Have you tried using the IP addresses of the machines, instead of names, you are pinging? Based on your earlier description you could assign IP addresses to the devices.
  29. Replies
    13
    Views
    1,042

    VS 2010 Re: Ping Network Computer

    If I had to guess it would be that it is PingException and the resolving mechanism did NOT resolve "Jack-Laptop".
  30. Re: VB.net - TreeView: Get the root name of a grand child node

    It's called recursion. https://youtu.be/YZcO_jRhvxs
  31. Re: VB.net - TreeView: Get the root name of a grand child node

    Try this


    Private Function GetParent(nd As TreeNode) As TreeNode
    Dim rv As TreeNode
    If nd.Parent Is Nothing Then
    rv = nd
    Else
    rv =...
  32. Replies
    13
    Views
    1,114

    Re: Mouse move event too slow

    You might try WndProc.



    Protected Overrides Sub WndProc(ByRef m As Message)
    ' Listen for operating system messages
    Const WM_MOUSEMOVE As Integer = &H200
    Select...
  33. Replies
    13
    Views
    1,114

    Re: Mouse move event too slow

    Using MouseMove I suspect that the best resolution you'll get is a location every 10ms.
  34. Re: Delete duplicate rows from XML file

    STOP with the pictures.

    Something like this(made up my own names because I couldn't copy the data because it was in a picture)


    Dim xe As XElement
    xe = <rows>
    ...
  35. Replies
    5
    Views
    795

    VS 2013 Re: Issues sending Gmail/Email

    Try port 587 instead of 465.
  36. Replies
    4
    Views
    591

    Re: Append elements in XML file

    The attachments aren't showing up.

    You changed the code I provided. Path was intended to be the path of the XML file. In your code I see that you are creating a path, so put the code back the...
  37. Replies
    4
    Views
    591

    Re: Append elements in XML file

    First of all attributes, IMHO, are for control information not data. Consider restructuring your XML. I have redone your code to use LINQ to XML. And in the posted code you'll find the ADD.


    ...
  38. Re: Reading/Writing to a file, fastest method?

    What kind of file size are we talking about?
  39. Replies
    8
    Views
    754

    Re: ProcessStartInfo

    Here is an example that uses Notepad as the process. Note that it uses await and async so that there is not a UI freeze. There wasn't much info in the OP so this is a guess.



    Private Sub...
  40. Replies
    3
    Views
    547

    Re: Same Data multiple threads

    You might also consider thread-safe collections instead of arrays.

    https://docs.microsoft.com/en-us/dotnet/standard/collections/thread-safe/when-to-use-a-thread-safe-collection
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width