|
I am using the RawValue Property of "Available KBytes" Performance Counter and also used the same one for "% Processor Time" under a Timer which updates the Text of the Label after every Second But I Get always a '0' for "% Processor Time" is there any other way of using this counter and also what about the real time graph how can i display it on screen.
AliAmjad (MCP)
|
|
|
|
|
Do you get values when you try the performance counter properties through the actual performance counter tool in the Admin Tools?
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
Paul Conrad wrote: Do you get values when you try the performance counter properties through the actual performance counter tool in the Admin Tools?
Yes i am getting values. But not on the form. I have actually created a new category and then created a copy of "% Processor Time" performance counter in it. What else should i do?
AliAmjad (MCP)
|
|
|
|
|
Ok I've found the Solution for this Problem I am using the following Code now:
Dim CPULoadCounter As New PerformanceCounter
Private Sub tmrUsage_Tick(ByVal sender As System.Object, ByVal e As system.EventArgs) Handles tmrUsage.Tick
Dim lCPULoadCounterNextValue As Single = CPULoadCounter.NextValue()
Me.lblCPULoad.Text = CType(lCPULoadCounterNextValue, Integer) & "%"
End Sub
Private Sub CPULoadCounterInitializer()
CPULoadCounter.CategoryName = "Processor"
CPULoadCounter.CounterName = "% Processor Time"
CPULoadCounter.InstanceName = "_Total"
End Sub
Can you please tell me how can i get the Total Physical RAM Size in VB.NET?
AliAmjad (MCP)
|
|
|
|
|
AliAmjad wrote: Can you please tell me how can i get the Total Physical RAM Size in VB.NET
I have found its solution too here it is:
My.Computer.Info.TotalPhysicalMemory
Thanks man for your cooperation !
AliAmjad (MCP)
|
|
|
|
|
why VB 2005 doesn't allow subreport on its integrate report object..
|
|
|
|
|
My input text from a .txt file is
this is the first line
this is the second line
this is the third line
I need to capitalize the first letter of each word by placing it in a textbox, I have the following code:
Dim aString As String = My.Computer.FileSystem.ReadAllText("input.txt")
Dim stringReturn As String
If My.Computer.FileSystem.FileExists("input.txt") Then
Me.xInputTextBox.Text = (Convert.ToString(aString.ToLower))
End If
Do While (aString.IndexOf(Space(2)) >= 0)
aString = aString.Replace(Space(2), Space(1))
Loop
Dim caparray() As String = (aString.Split(" " & "ControlChars.NewLine"))
For I As Integer = 0 To caparray.Length - 1
If caparray(I).Length = 1 Then
caparray(I) = caparray(I).ToUpper
Else ' ***join them back together
caparray(I) = caparray(I).Substring(0, 1).ToUpper & caparray(I).Substring(1).ToLower
End If
Next
stringReturn = String.Join(" ", caparray)
Me.xInputTextBox.Text = (stringReturn.ToString)
My output is then
This Is The First Line
this Is The Second Line
this Is The Third Line
It will not capitalize the first letter of the second and third line. Can someone please tell me what I am doing wrong?
Thanks, Jesi
|
|
|
|
|
JessicaD523 wrote: This Is The First Line
this Is The Second Line
There is a newline but no space between Line and this, so to your algorithm they are
just one word! A simple debug session would have told you that.
You will have similar problems with punctuation: "aha" will be seen as a word starting
with " not a.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thank you, I kind of thought that was the problem...but how do i fix that? I'm very new at vb.net. Thanks.
Jesi
|
|
|
|
|
Hi Jesi,
JessicaD523 wrote: but how do i fix that?
as always:
1. define the requirements as accurately as possible (what is a word, which
words need capitalization, ...)
2. analyze, design, implement, test
3. iterate until satisfied.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
stringReturn = String.Join(" ", caparray)
I do not have your answer but what does this String.Join do, is it joining the first line to the second line and so on?
Can you use vbcrlf to go to the next line or 'proper case' instead of 'upper case'.
|
|
|
|
|
How do i call Other programs like office and Excel , Outlook From my VB App
|
|
|
|
|
The esiest way to launch any external application or file is to use Start method of System.Diagnostics.Process class.
Following line may be used to start MS Word application –
System.Diagnostics.Process.Start("C:\Program Files\Microsoft Office\OFFICE11\winword.exe")
You should change the path of winword.exe according to your installation folder.
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hi,
I am using VB in MS ACCESS and is not able to update a date field in the database, I am taking the value from a textbox in the form.
This is the query I have been using...
s = "Update Table1 set DOB = """ + Text2.Value + """ where name = """ + Text0.Value + """ "
DoCmd.RunSQL (s)
It is showing the type mismatch error.
Can somebody please help me with this.
Thanks
|
|
|
|
|
A date in Access is written between # characters, not quotation marks.
A string in SQL is written between apostrophes ('), not quotation marks.
You should read up on SQL injection. Your code is wide open for SQL injection attacks.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Hi ,
I am writing a datatable to xml file , i am using xmlwriter in vb.net to write .I am setting the prefix by writing the namespace using these things
xw.WriteStartElement("Name")<br />
xw.WriteStartAttribute("fn",nothing, "c:/Font.xsd")<br />
xw.WriteStartAttribute("txt", "Text", "c:/Text.xsd") so that i can use the prefix in the program while using <br />
xw.WriteStartElement("txt", "TextBackColor", Nothing)<br />
xw.WriteString(dtTextBox.Rows(iTextBoxesCount).Item("BackColor").ToString())<br />
xw.WriteEndElement()
i am getting the output like this on top of xml page
<Name <big>fn="" lbl:Label="" txt:Text="" pos:Position="" xs=""</big> xmlns:xs="http://www.w3.org/2001/schema-instance" xmlns:pos="c:\Position.xsd" xmlns:txt="c:\Text.xsd" xmlns:lbl="c:\Label.xsd" xmlns:fn="c:\Font.xsd">
Now the thing i dont want these things highlighted in bold .This is the exta information .How to remove these things ??
Thanks,
Dvs
|
|
|
|
|
I am trying to develop a application using vb.net. printer connected with server also it shared with all their clients. now my application exactly find the printer status like how many print made by particular system. examble if i give 10 copy print from system1 and 5 copies from system2, my application in server system store this information like
system1 - 10 copies - date & time
system2 - 5 copies - date & time
( pear to pear network )
please any one help me
|
|
|
|
|
|
Hi
I am writing a datatable to xml file ,so in the meanwhile i wanted touse the .xsd file to validate the xml format. how to use . presently , i am using xmlwriter to write .In that i am uisng writestartelement(string ,namespace,) ,writeAttribute,etc . I am writing in it but how toknow whether it is correct or not . I want to set the prefix also .I used the namespace on the top ,but how to use in vb.net to get done like this .I am getting without this txt:, fn:. I have to generate from xsd .
i want like this , i am looping my datatable .How to set fn,txt
<code> <txt:TextBox TextIndex="1">
<txt:TextName>Text1</txt:TextName>
<txt:TextAlign>0</txt:TextAlign>
<txt:Appearance>1</txt:Appearance>
<txt:TextBackColor>-2147483643</txt:TextBackColor>
<txt:TextForeColor>-2147483640</txt:TextForeColor>
<txt:TextBorderStyle>1</txt:TextBorderStyle>
<txt:TextText>Text1</txt:TextText>
- <fn:Font></code>
I am new to this topic .
Any references for that or suggestions
Dvs
-- modified at 6:41 Saturday 20th October, 2007
|
|
|
|
|
I want to develop an windows application that will retrieve emails from my gmail's account.
I am trying to do it using socket class as follows -
TCP = New Net.Sockets.TcpClient
TCP.Connect("pop.gmail.com", 995)
but after this I didn't get any response.
So how to retrieve mail ?
|
|
|
|
|
You say no response, but fail to identify what no response means.
Did pop.gmail.com fail to resolve to an ip, did the server reject your connection or did you successfully connect and authenticate a pop3sl connection?
Have you implemented your pop3 sl client correctly according to RFC 1939, 2449 and 2595 (not sure if any others apply now)?
A little more detail may elicit more of a response from the community.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
hi everyone, i am trying to do this and i need some serious help on this, i need to develope an "Technology Conference Registration" small program for my intro to visual basic class.
here is the info i recieved from my professor:
Technology Conference Registration
DIMC has requested that you develope a mobile application that can determine and display the total cost per company for developers attending the conference. DIMC has a conference policy that states if any member of a company has attended a previous DIMC conference, the company recieves a 15% discount from the total coast of its employess who attend. The policy also states that no more than 16 people from a single company can attend the conference. DIMC has asked that you design the program so that the user must enter valid data.
number of conference registration Cost per Attendee
per company
1 $695
2-4 $545
5-8 $480
8 or more $395
that is in my book this isn't for a real company but that is what i need help with i really need help with some coding, anyone think they can help me?
/J-Man\
|
|
|
|
|
Have you tried to do this yourself? People here will be willing to help you if you get stuck with specific problems, but no one is going to do your work for you.
The problem seems to be pretty well stated and should provide you with enough information to list the requirements. Once you list out the requirements, think about what you need to do in order to accomplish each requirement.
I will give you a few pointers...you will need some sort of database in order to keep track of who has previously attended a conference and the actual conference registrations. You will also need the front-end application. Even though the problem specifically says it must be a mobile device, don't let that limit how you would design the solution from a "big picture" standpoint. The high-level requirements will be the same no matter what, and the underlying architecture will be pretty much the same as well. The biggest impact it will have will be on the choice of user interface controls and layout.
|
|
|
|
|
well the thing is, i really have no idea how to do this. I don't even no were to start. I just started and our professor got pissed and assigned this to our class because of everyone having trouble, i no she said not to use a database and to just "think about it and you'll get it"
but thanks anyway,
Jesse
P.S. What should be the first thing i try?
/J-Man\
|
|
|
|
|
using ErrorProvider in VB HELP!!
My problem is the errorProvider show but it doesn't stay visible? it is just visible for a split of second after the MSGBOX has been click OK then after that? it seems it automatically dispose or hide itself that it wasn't mean to be???
I don't know why?? Please anyone with a kind heart to help me with this difficulties of mine?? please be patience about my bit of ignorance with this control i've just used this control for the first time.. ehehe.. ERRORPROVIDER in VB...
**************
Sub OnErrorMessage(ByVal controlOnError As Control, _
ByVal errorMessage As String)
ErrorProvider.SetError(controlOnError, errorMessage)
MsgBox(errorMessage, MsgBoxStyle.Exclamation)
controlOnError.Focus()
End Sub
Function DataFieldValidation() As Boolean
Dim valid As Boolean = True
Try
If String.IsNullOrEmpty(txtboxLastname.Text) Then
OnErrorMessage(txtboxLastname, _
"LastName TextField is required and could not be empty..")
valid = False
Exit Try
End If
Catch ex As Exception
MsgBox(ex.ToString())
End Try
Return valid
End Function
Friend Sub UpdateRecord()
Try
Me.Cursor = Cursors.WaitCursor
If DataFieldValidation() = False Then
Me.Cursor = Cursors.Default
Exit Sub
End If
' i've ommitted other database transaction codes here
' to minimize this post
Me.Cursor = Cursors.Default
Catch ex As Exception
MsgBox(ex.ToString())
End Try
End sub
**************
advance thank you so much to any reply.. please...
-- modified at 22:21 Friday 19th October, 2007
|
|
|
|