i'm making a small app to remotely monitor around 15 servers over our network, I need to get the current CPU usage, memory, disk space and network utilisation. I've got everything I need using performance counters in VB.net via the following (one for each item I want to monitor).
Code:
PerfCnt_CPU = New PerformanceCounter("Processor", "% Processor Time", "_Total", CurrentTargetPC)
PerfCnt_Mem = New PerformanceCounter("Memory", "Available MBytes", Nothing, CurrentTargetPC)
PerfCnt_Disk = New PerformanceCounter("LogicalDisk", "% Free Space", "C:", CurrentTargetPC)
PerfCnt_NetIn = New PerformanceCounter("Network Interface", "Bytes Received/sec", NetworkAdTarget, CurrentTargetPC
[Code]..
Is there a better way for me to watch the remote performance data, maybe through WMI I already connect via WMI to get the remote OS version, boot time etc.. but if anyone can give me an example of the most efficient way to watch the perf data over WMI (or a better way).
is it possible to monitor my RAM-memory use of my application using a PerformanceCounter? If so, I've been looking around on the web, but my knowledge about memory isn't enough to understand what precisely I have to use
I have a performance counter set up to pull % Processor Time on a remote machine.
Heres the code I use to pull it:
Code: Private cpuCounter As PerformanceCounter = Nothing Try cpuCounter = New PerformanceCounter("Processor", "% Processor Time", "_Total", strServer)
[Code].....
However, sometimes it can take 40-50 seconds for this one counter to process.. when its been created (the 'cpuCounter =' line), then it runs just fine, I can pull nextvalue without any problem.. but creating it takes forever.
This only happens the first time I run my program and it only happens with the first counter, and it doesn't ALWAYS happen.
PerformanceCounter.NextValue appears to return integer values instead of single values.The code below has a button, Button1 and a textbox, TextBox1. Click on the button and the textbox is filled with the CPU usage of each process at a given time. I would assume that these values should match with the values in task manager.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = Now.ToString & vbCrLf & vbCrLf TextBox1.Text &= GetInfo() Application.DoEvents()
[code]....
My guess is that these processes are taking up SOME amount of CPU and are just being rounded down to 0. In the first example I would guess that the CPU amount is rounded up to 100 %.
I'm calling the following method from a button click event to export a datatable to excel. After the export is completed, the excel application object is quit, released and assigned to nothing. But in reality it's not getting released and stays active unless the entire application is closed. So every time the button is clicked for export, a new excel application object keeps on running. The problem doesn't occur if two of the lines from the method below are not used. But I can't omit them as they are really needed. Check the * marked lines.
Code: ''' <summary> ''' Exports data from a datatable to excel. ''' </summary>
How to change the frame rate in Visual Basic 2008 Media Player? I have error: System.NullReferenceException was unhandled Message: Object reference not set to an instance of an object. IS there any way to fix this? Here's My Code
i'm running Visual Basic 2008 Express Edition (latest service pack ... 9.0.30729.1 SP) on XP Pro SP3 with .Net Framework version 3.5 SP1 I have a rather large project I've imported from Visual Studio 2003 (Standard).The project compiles and runs just fine ... my compiled program itself never crashes.
But while I actually have the code up in the IDE, and simply adding/deleting code the whole IDE will randomly crash (usually without warning) and I loose my changes since last save.If/when I do get some hint of why it crashed, I get a window about illegal whitespace or something.... but that's rare ... usually it just crashes without warning and the whole IDE completely shuts down instantly. just deleting/adding a character is enough to trigger it maybe once every 30 minutes.
This is on a computer that is otherwise very rock solid .... no other program ever crashes, etc.
this event works ok, but the problem is that I don't know what field was clicked. Should I use objectinfo or something else? VB.net won't recognize for example e.objectinfo.
problem use Visual Studio 2005,2008 with Microsoft SQL Server 2008 R2 , when open vb.net choose : add new data source and choose database and add connection when choose Microsoft SQL Server (SqlClient) show error this version not supported
What i need to write is i get different signal from PIC16F877A and through serial port, i need to display diffrent text from different signal, Such as: Signal from portB.1 display 1, signal from portb.2 display 2. Between the microcontroller and serial port im using MAX232.
Using VS2008 as frontend and MS SOL Server2008 as backend... a database is created in MS SQL Server2008(SQLEXPRESS). Now the problem is i am not being able to to load the database created in MS SQL Server2008(SQLEXPRESS) onto VS.Net 2008...
I use the 'Process' object to run EXE from my application. It works fine when it run on Windows XP and 2003. When it run on Windows server 2008, it hangs up: the process is stayed in background but never returns. It never goes ahead for the next commands. What could be the reason? [Code]
I use the 'Process' object to run EXE from my application. It works fine when it run on Windows XP and 2003. When it run on Windows server 2008, it hangs up: the process is stayed in background but never returns. It never goes ahead for the next commands
Having problem in updating an existing record. An error occurs "Data Type Mismatch in Criteria Expression"
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click Dim myBuilder As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(dataAdapter)
Is there a way to validate a groupbox with a couple radiobuttons in it to make sure that one of the radiobuttons is selected?
Heres why I need this. I need a user to be able to select their class rank out by way of radiobuttons in a groupbox. When they click submit, I need to validate that atleast one of the radiobuttons got selected and if not display a messagebox.
I got one reply early of:
If myGroupBox.Controls.OfType(Of RadioButton).Count(Function(rb) rb.Checked) = 0 Then 'There is no RadioButton checked in myGroupBox. End If
Is there any other ways other then that? Preferrably a more 'dumbed' down way? This is for just an entry level VB class, I would prefer not to use something of that nature if there is another way.
I am running a program that is connected through the internet and i gets disconnected at times.wanted to know how this would be to examine a color of a pixel , If the colour turns changes, my mouse will move to reconnect
I get the message "Please wait while Windows configures Microsoft Visual Studio 2008..." whenever I build the install project for my application. It configures VS for a while, then builds the project. This does not happen when I build the vb.net application itself, only the installation project in the same solution. This occurs on applications using the Leadtools library, but not others.
I have been working on an app that was basically a vb6 app but had to be changed and I did it all using VB 2008. works well, great. One of the problems that I had was to work on different groupboxes or frames. Since they are layered on top of each other, working on one frame would mess up the others. Eventually it all went okay. but now if i want to add another item in the menu and hence add another groupbox (or frame) in the same app - it would definitely be a nightmare.
I recently created a very simple project in VB express 2008 to interface with a COM object from an external vendor. I then downloaded the VS2008 90 day trial and found that the identical code in a VS2008 project results in a COMException error "Object is out of scope". Is anyone aware of any differences in how the two packages handle COM object interfaces as I have run out of ideas. Both projects have identical code and all the references are the same. The CreateObject() method correctly creates the object, but any attempt to access methods inside the COM object result in that error. I can even open the VB 2008 Express project inside VS and it still generates the same error.
Here is the code - the vendor dll in question is from Siebel v8.0.0, you'll notice that I have commented out most of the code that comes after the error. Creating a watch in the debugger on the siebApp variable sees it correctly created as {System.__ComObject}type SiebelHTMLApplication. I first tried this by creating the Property Service for variable siebSvcs, but after I started experiencing the COMExceptions, I reverted to using the most basic method inside the COM object I was creating.
using Vb Net 2008 with SQL Express 2008 R2 in windows forms. that being said, I have a syntax problem in this form, form has 2 texbox an a datagridview and also the 4 components DataSet. BindingSource. TableAdapter, BindingNavigator. When I filter by LastName no problem it work fine (it's a String) but when I try to filter by CustomerID (it's alphanumeric) I get an error "Invalid character" here is part of my code: Private Sub surnameFilterTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles surnameFilterTextBox.TextChanged
I recently installed vb express 2008 and with that download i also installed Sql server 2008. Earlier i have been working in MS Access so i have no experience in SQL server. My first problem is how to start sql server. I can see only following:
Start>All Programmes>MS SQL server 2008>Configuration Tools, Import and Export Data(32 bit)>SQL server configuration Manager,SQL server Error and Usage Reporting,SQL server Installation Centre. Moreover in Programme Files i have two folders:
1. MS SQL SERVER and 2. MS SQL SERVER COMPACT EDITION
how to start to create a database in SQL server with Vb express 2008.
after that, I try to add crystal report 2008 component to VB.net .By right click on toolbox choose items and checked crystal report viewerIt doesn't seem works, there is no crystal report 2008 component on toolbox
I have this code, to read image (saved as varbinary(max) in database):
Private Sub ReadImage() Dim connection As New SqlConnection(strConnectionString) Dim command As New SqlCommand("SELECT [Image] FROM z1 WHERE x=1 AND y=1", connection)
[code]....
But it isn't very convenient code. It reads bytes from table, save them to file, and finally open file as image.How can I read it directly to image, without saving as file?
I Am trying to connect to the database(in Sql Server 2008) through my vb.net desktop application, perform a backup, and then allow the user to save the backup file to their computer Using Save Dialog box in vb.net 2008.