|
Try this
Dim arNames() As String = Split("james,martin", ",")<br />
Dim sName As String = arNames(0)<br />
Dim fName As String = arNames(1)
|
|
|
|
|
THANKS A LOT,
THIS ALSO WORKIONG YAAR,
Dim memberName(2) As String
Dim memberLName As String
Dim memberFName As String
memberName = memberNameTextBox.Text.Split(“,”)
memberLName = memberName(0).Trim
memberFName memberName(1).Trim
self confidence+hard work=SUCCESS
|
|
|
|
|
Just a minor issue, this produces a 3 element array 0,1,2
Dim memberName(2) As String
This is not relevant to your current code but will trip you if you ever use memberName.lenght (which is 3 NOT 2)
|
|
|
|
|
Hi to all,
I am Developing to develop Client/Server Application using VB.NET 1.1
1)I want to see the Client Machines Performance and Networking details like what you get in windows Task manager using vb.net.
2) How to find the passives client. and From server I want to shout down these machines.
3.If any Illegal process started (Virus) the I want sent server to pop up alert Message for client machines.
Thanks
Mohan Balal
--------------
(Sr.Software Engineer)
|
|
|
|
|
Member 1258373 wrote: 1)I want to see the Client Machines Performance and Networking details like what you get in windows Task manager using vb.net.
This can be done using the Process class, Performance Counters, and WMI. If the remote machines are in a domain environment, then the account your code is running under should have the appropriate permissions to the remote machines. If in a workgroup configuration, then you'll have to supply an appropriate username and password for EACH machine you want to connect to to get this data.
Member 1258373 wrote: 2) How to find the passives client. and From server I want to shout down these machines.
What do you mean by "passive client"?? Shutting down machines remotely has it's issues, since you'll need admin rights to the machines. Also, forcing a shutdown without knowing what the machine, and it's users, are doing is a "data loss" concern. You don't know, and can't find out, what the machine is doing or waiting for.
Member 1258373 wrote: 3.If any Illegal process started (Virus) the I want sent server to pop up alert Message for client machines.
There is no way for you to know that any code is virus related. This is better left up to a professional, enterprise virus scanning package that reports back to a central server. You'll have to keep this virus software up-to-date on a daily basis. If you attempt to write this code youreself, you will be greatly disappointed in the amount of work you have to put in to maintain it and keep it updated with the latest techniques for getting bad code to run. This is something that a single person, such as yourself, simply cannot do due to the number of viruses discovered every day.
|
|
|
|
|
In Visual Basic .NET I know how to get the environment params (such as USERPROFILE) that gets assigned to a user when they're logged in on a given system. But how do you get those environment params for those users when another user (or the administrator) is logged in? A code snippet showing that would help out greatly.
As an added bonus, if you know of a way to query all the users who have an account on a local system I could use that. Thanks much.
|
|
|
|
|
Actually the added bonus is the easy one - look in the documents & settings folders and parse the folder names!
I think to get all the environment vars is not going to be possible (maybe one of the OS experts will be able to help). I think you would need to locate all the tags in the registry and every app that starts automatically on startup - impossible!
|
|
|
|
|
Hi everyone.
I'm trying to build a session enumeration for a asp.net site, meaning that i can see all live session and their objects of the session, at start i built a IList of httpsession that i add to it the session every time its created, the problem is that when the session has changed(like adding a new object to the session) the list is not updated with the changes it just stays like the same point when it was added. i need a linked collection that a can add objects to it but when the object change it should be seen in the collection too.
can anyone help please?
thanks.
|
|
|
|
|
If you had an OnChange event on the objects this would give you the place to deal with it!
|
|
|
|
|
Hey guys (and gals),
I am trying to perform some basic calculations on a frmTimeAllocation that I am designing. As the users input the % of time spent among 4 projects, I would like the unused % time to be recorded in a lablel on the from. Below is the code I am using, but so far its not working for me - the % remains at 100%. Any suggestion on where I should go from here? TIA.
Private Sub updTime1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles updTime1.ValueChanged, updTime2.ValueChanged
Dim TimeWorked As String
Dim Time1 As Single
Dim Time2 As Single
Dim Time3 As Single
Dim Time4 As Single
Dim Rest As Single
TimeWorked = 100 / 100
'unallocated time across projects
Rest = TimeWorked - Time1 - Time2 - Time3 - Time4
If Rest > 0 Then
'Me.lblMessage.Text = Rest.ToString("c") & " still unallocated time"
Me.lblMessage.Text = FormatPercent(Rest, TriState.True) & " still unallocated time"
Else
Me.lblMessage.Text = ""
End If
End Sub
|
|
|
|
|
Hi,
why is TimeWorked declared a String???
did you look at its value after execution of TimeWorked = 100 / 100 ?
either print it out, or single-step your program (set a breakpoint!)
where are Time1/2/3/4 set to specific values?
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Luc,
I have tried different approached, including the below:
Dim TimeWorked As Single
Dim Time1 = updTime1.Text
Dim Time2 = updTime2.Text
Dim Time3 = updTime3.Text
Dim Time4 = updTime4.Text
Dim Rest As Single
My desire is to be able to progressively calculate the unalloacted time as the user inputs a value in each of the updTimex fields.
IT
|
|
|
|
|
which isn't good either, you want all variables having the same type (say Single), so Time1/2/3/4
should also be Single; then you better explicitly convert the String that is in TextBox.Text
to a Single, probably using Convert.ToSingle().
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Just wanted to close the loop on this; I got it working as desired. Thanks Luc.
Private Sub updTime1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles updTime1.ValueChanged, updTime2.ValueChanged, _
updTime3.ValueChanged, updTime4.ValueChanged
Dim TimeWorked As Decimal
Dim Time1 = Convert.ToDecimal(updTime1.Text)
Dim Time2 = Convert.ToDecimal(updTime2.Text)
Dim Time3 = Convert.ToDecimal(updTime3.Text)
Dim Time4 = Convert.ToDecimal(updTime4.Text)
Dim Rest As Decimal
TimeWorked = Time1 + Time2 + Time3 + Time4
'unallocated time across projects
Rest = (100 - TimeWorked) / 100
If Rest > 0 Then
Me.lblMessage.Text = FormatPercent(Rest) & " of your Time is still unallocated."
Else
Me.lblMessage.Text = ""
End If
End Sub
|
|
|
|
|
You're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Just a ?
Dim TimeWorked As Decimal This is obviously decimal
Dim Time1 = Convert.ToDecimal(updTime1.Text) Would this not be an object (admittedly with a type decimal as content)
And the rule is.... NO BLOODY VARIANTS
Dontcha love the old VB style, just declare the dammed thing I just want to use it not dance it round the room!
|
|
|
|
|
Mycroft Holmes wrote: Would this not be an object
yes
Mycroft Holmes wrote: Dontcha love the old VB style
no
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I need to know how to do two things.
How do I make it so that no date at all is the default date in a date time picker. I noticed that the date time picker displays the current date by default.
How do I set the date to a particular date using a date time picker. I will get the date from a database and put it into a dataRow.
|
|
|
|
|
1 - I don't think you can, it needs to show *something*
2 - I expect you set the same property ( Value, perhaps ) that you get after it's been shown to see what was selected.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
1. Are you talking about nullable datetime picker? There are a few articles here.
2. You set the datetime picker's Value property, or do a databinding.
|
|
|
|
|
Hello experts!
I've ran into a problem in my VB.NET coding. I've created a form with no border and is painting it with pixels-transparent PNG images using UpdateLayeredWindow. At the moment, the form is moving using the "caption" function in WndProc, the NCHITTEST thing..
The problem is, that it want to make the form able to "snap" to other forms also painted with UpdateLayeredWindow. I've already tried a lot:
Protected Overloads Overrides Sub WndProc(ByRef m As Message)<br />
Select Case m.Msg<br />
Case 512 ' mouse move<br />
<br />
If ((Me.Location.Y + Me.Height) > (frmEvent.Location.Y - 10) And (Me.Location.Y + Me.Height) < (frmEvent.Location.Y + 10)) Then<br />
Me.Location = New Point(Me.Location.X, frmEvent.Location.Y - Me.Height)<br />
'MsgBox("yes")<br />
End If<br />
Case 70 ' windows position change<br />
drawstring += 1<br />
<br />
If ((Me.Location.Y + Me.Height) > (frmEvent.Location.Y - 10) And (Me.Location.Y + Me.Height) < (frmEvent.Location.Y + 10)) Then<br />
Me.Location = New Point(Me.Location.X, frmEvent.Location.Y - Me.Height)<br />
'MsgBox("yes")<br />
End If<br />
Case 132 ' NCHITTEST<br />
m.Result = New System.IntPtr(2)<br />
If ((Me.Location.Y + Me.Height) > (frmEvent.Location.Y - 10) And (Me.Location.Y + Me.Height) < (frmEvent.Location.Y + 10)) Then<br />
Me.Location = New Point(Me.Location.X, frmEvent.Location.Y - Me.Height)<br />
'MsgBox("yes")<br />
End If<br />
Return<br />
End Select<br />
MyBase.WndProc(m)<br />
End Sub
However, this does not work (the example only includes snapping to the top of another form called frmEvent). When I move the form above the other form, it sometimes "blinks". If it doesn't blink, it will just do nothing. When I have the form where it is supposed to snap, it will first be snapping when i release the mouse.
Can anyone help me here?
Greetings..
|
|
|
|
|
Hello...
i need help wid user input via a table.Searched high n low,but got no solution.
My problem: i want the user to TYPE in data into a table (or table like structure,dat looks like a data grid) and then, on the click of the save button,the data is saved to the database i.e into the actual table in the database.
for example:
name age state country
---
---
---
---
and so on
|--------------|
| SAVE |
|--------------|
....all done at the front end,in order to simulate data entry into an actual table.
How do i do dis?????
Data grid has dat kind of structure...sadly it takes no input.
Can anyone temme how dis cud b accomplished?
Hmmm....VB.net must have some visual 'table' like control,like there is in microsoft word and excel,dat cud make data entry of dis sort possible...
there's something for a treeview,but no TABLE!!!!
|
|
|
|
|
wid and dat are not words. Neither is temme, dis, cud, or b. We are grown ups here, we're not 7.
Perhaps if you used english when you typed stuff into google, you'd find the various grid controls. Of course, you need to write some code to stuff those values into your databaser.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am working on a program that stores peoples data, only while the program is running thouugh. I want to create an array to store thier details. I want to store 10 users details. I have:
txtName = Their Name textbox
txtAddress = Their address textbox
txtAddress1 = Their address textbox
txtAddress3 = Their address textbox
txtPhone = Their phone number
I also want to store whats in cmbboxCar = car list combobox
I have a button called "txtStore" that will store the details when pressed, but don't know to do that.
I have a numericupdown = detnumber which when value is increased/decreased I want it to display whats stored in the current array index number. Say "5" was selected in the numericupdown, I want the details for person 5 to appear in all textboxes, comboboxes. But I want the updown to only go as high as the number of values stored. e.g. if 6 users details were stored, the numericupdown wont go higher.
Any ideas?
Thanks in advance
In the end we're all just the same
|
|
|
|
|
If you create a collection and insert the data, you can serialize the collection to disk and then load it again when the program restarts.
There are 100's of examples of this on the Internet. Very simple to do, just a few lines of code.
modified 27-Feb-21 21:01pm.
|
|
|
|