Results 1 to 6 of 6

Thread: [RESOLVED] COUNT func

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2007
    Posts
    76

    Resolved [RESOLVED] COUNT func

    Hi all

    I am writing (slowly) a VB.net application for my AD.

    Got the AD integration working, and got the computer name parsing to a variable, but it has CN= in front of it, which I don't want. Is there any way I can ask VB.net to strip this out? I know in excel there is a count() function (if I am right?). Anything similar in vb.net?

    Response muchly appreciated thanks.

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: COUNT func

    Lets say your string variable is named ComputerName then you could do this:

    vb Code:
    1. ComputerName = ComputerName.Remove(0, 3)
    and that will remove the first 3 characters from the string That is what I do in my AdTreeView control that you were looking at
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2007
    Posts
    76

    Re: COUNT func

    chris128 - you seem to be my saviour. I'm parsing details from your control into another textbox .

    thanks so much

  4. #4
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: COUNT func

    No worries I would have thought if you were doing that you would just grab the text of the currently selected node, like so:

    vb Code:
    1. MyTextBox.Text = AdTreeView1.SelectedNode.Text

    or maybe thats not what you are trying to do, I dunno

    PS if you have everything you need from a question/thread on here then mark it as Resolved by using the Thread Tools menu at the top of the page and rate people that helped Who said that!?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 2007
    Posts
    76

    Re: COUNT func

    Will do, nah i'm trying to do something else there is a method in my madness!

    It won't let me give you any more until I spread it more, I did try!

  6. #6
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: COUNT func

    ah right fair enough just mark the thread as resolved then

    PS I've nearly finished updating that control, I'll post it in the codebank thread shortly
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width