|
Good Day All
I created 2 batch files to run a command line program...the first runs the actual program and accepts in a parameter, and the second batch file runs the first batch file with the parameters I give it.
I now need to get some information from this process, the first is the time taken to complete the process, and the second is to get the memory used.
I am trying to create a VB console application (not sure if on the right track) to run the executable, the same way I did in the batch files (sending parameters to a command line program).
Getting the time taken is no problem. my problem is getting the VB console to call the executable (not sure how to do that), and the other problem is getting the amount of memory used running the VB program.
The memory used, is not so important at this point (I can work on that later). I would like to know if anyone could help me with running the executable within my newly created program.
Thanks in advance!
|
|
|
|
|
Look into the Process class (Process.Start("SomeApplication.exe") , Process.HasExited , Process.ExitTime , etc) to launch the app you want to monitor.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thanks for the assistance. The first bit helped, now I just have to look into it in more depth to extract some further information from the process.
Thanks again!
|
|
|
|
|
Have a look at System.Diagnostics.Process class.
|
|
|
|
|
I will look into this. Thanks!
|
|
|
|
|
Hello.
The problem is this: I have two tables:
Requirements(ID_doc, Name_doc, ID_DeliveryType) and
DeliveryTypeCodeList(ID_DeliveryType, DeliveryType_doc).
I put the form fields from the table ‘Requirements’ where the column ‘ID_DeliveryType’ is ComboBox type-a. For ComboBox DataSource I put table ‘DeliveryTypeCodeList’ where column ‘DeliveryType_doc’ is DisplayMember and column ‘ID_DeliveryType’ column is ValueMemeber.
Requirements
--- ID_doc - Name_doc - ID_DeliveryType
________________________________________
-----1--------doc1----------23----------
-----2--------doc2----------23----------
-----3--------doc3-----------2----------
-----4--------doc4-----------3----------
DeliveryTypeCodeList
--- ID_DeliveryType - DeliveryType_doc
________________________________________
---------2--------------poste-----------
---------3---------------fax------------
--------23---------------mail-----------
My wish now is that when I run the program, in the ComboBox it print (descriptive)values from the column 'DeliveryType_doc' (mail, fax, post)!
But it just does not happen?!???
If you have time, there is also the source code of the program: http://rapidshare.com/files/305140006/BugComboBox.rar
or if you want you can see the video where I show that I have tried all combinations: http://www.youtube.com/watch?v=5VK-c39eL-4
THANK YOU!
|
|
|
|
|
Noone is going to download your entire project. You have to post the relevant code that sets up the ComboBox and do a better job of explaining what you want. I'm not entirely clear on what the problem is.
|
|
|
|
|
Watch the video http://www.youtube.com/watch?v=5VK-c39eL-4
and all will be clear.
By the way, there is no code associated with ComboBox.
|
|
|
|
|
Apart for not having any code in the project, the WHOLE thing is 160 KB, so why not download it and try what we did.
The project contains only the part that is relevant to the question, and a dummy database that is needed for it.
It contains no code, since we are trying to program the MS way: clicking, dragging and dropping components, without or at least with minimum code written by hand.
That is why we posted the video (11 MB) on the youtube, so people can see what we are trying to do.
So please, if you have an answer, do post it, otherwise, thank you for reading our question.
|
|
|
|
|
huamala wrote: so why not download it and try what we did.
Because I don't run code I do not trust.
You post the relevant code here in your post in PRE tags...
|
|
|
|
|
use Total Comander to see the files or you can look at the VIDEO.
|
|
|
|
|
Dear codeproject.com administrators and members,
A greeting of peace. I hope everyone is doing fine upon reading this forum.
Well, it's really my first time to try Visual Basic .NET, then I realized that not all my previous experience with VB6 will work smoothly in VB.NET. I am creating a simple program that will enter a name in the TextBox and will greet them by using the MessageBox class. But I wonder, since the TextBox that I'll be using is for inputting a name, I want to "trap" all numeric keys in my keyboard, I just don't know how to do it. This is fair easy in VB6, using the Text1_KeyPress(KeyAscii As Integer) subroutine.
Thank you and more power to all administrators and members. God bless.
Respectfully yours,
MarkSquall
|
|
|
|
|
Fortunately it is pretty much equally easy in VB.NET, and in some ways even easier:
This example will actually do the opposite of what you are trying to do, but it is easy to adapt to your needs, and I think it shows how .NET makes certain operations even easier than VB6.
Private Sub Text1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Text1.KeyPress
Try
If Not (Char.IsNumber(e.KeyChar) Or Char.IsControl(e.KeyChar)) Then e.Handled = True
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
A nice little added advantage can be found in the Handles bit: here you can actually add other textboxes, if you want them to behave the same way. (Handles Text1.KeyPress, Text2.KeyPress, Text3.KeyPress )
My advice is free, and you may get what you paid for.
|
|
|
|
|
How can I when double click on a node, I can edit it?
I mean the node is a treeview.
Thank you before answering.
I am waiting for your answer.
|
|
|
|
|
Handle the double click event, it will presumably be passed the node, so delete it from the Items collection in there.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Handle the double click event on the treeview
use hittest to see if there is a node under the click
Get the node from the hittest
get the parent node from the node
get confirmation from the user
delete the node from the parents node collection
|
|
|
|
|
Dear Friends Thank you very much gave the answer
Especially Christian Graus and Mycroft Holmes.
Code is very good. I hope you succeed
|
|
|
|
|
You want an example,Or a project for me to upload in this field.
thanks!
|
|
|
|
|
You want to edit the label or delete the node itself ?
If you want to enable automatic label edit, try:
TreeView1.LabelEdit = true;
If you want to delete the node, try Mycroft Holmes' post.
|
|
|
|
|
Hello Experts,
I m using Crystal Report for generating Report. In which I m using OLE Object of Word Application and Select the File of 10 Pages.
But it shows only First Page of Word Application. So plese advice me how to show all pages of word application in Crystal Report .
Thanks
If you can think then I Can.
|
|
|
|
|
Hello!
I have some data and I'm needing to analyze it, like the example:
My Data
Date Time Rate
20081005 00:55 15
20081005 00:56 14
20081005 00:57 13
20081005 00:58 14
20081005 00:59 11
(...)
I need to evaluate how many times the "Rate" is above certain value (10 for example), how long it be above this value. Also I need to register every time in which "Rate" becomes below 6 for more than 10 minutes, and for how long.
Thanks
|
|
|
|
|
For starters, VB6 is no longer supported, so perhaps you should consider VB.NET Express.
That said, the way to check your data depends on how your data is stored. If it's in a SQL Server database (or similar) a simple SQL statement would be the best way.
If it's in a text file, you will need to open the file, read it one line at a time, parse the line, count the number of times the Rate is out of the range you are looking for etc.
More info is needed. What have you tried already? Where are you stuck?
|
|
|
|
|
I Have this data in CSV files, so i imported them to a DBGrid, i've tried some SQL, but I could only "filter" the results.
I'm gonna consider VB Express 2008.
modified on Wednesday, November 11, 2009 7:51 AM
|
|
|
|
|
Import the CSV file to an SQL Server database table and use SQL queries to do it. Download SQL Server Express, it's free.
|
|
|
|
|
hello every1 , am new to programming. am doin my dissertation on cd database in vb.net. my software should retrieve information from a cd that is manually put into cd drive. software should copy cd info like the artist , name, song , et into a database.
This is where am stuck. am havn problems copying the cd info successfully. now my deadline is in just 1month. This code below was workin few days ago .. now it isnt.
PLS I NEED HELP.. AM DESPERATE..
Imports System <br />
<code>Imports System.Collections.Generic <br />
<code>Imports System.ComponentModel <br />
<code>Imports System.Data <br />
<code>Imports System.Drawing <br />
<code>Imports System.Text <br />
<code>Imports System.Windows.Forms <br />
<br />
<br />
<br />
<br />
<code>Namespace CdRomManagement
Public Partial Class Form1 <br />
Inherits Form <br />
<br />
<br />
<br />
Public Sub New() <br />
<br />
InitializeComponent() <br />
End Sub <br />
<br />
<br />
<br />
<br />
<code>Private Sub axWindowsMediaPlayer1_CdromMediaChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_CdromMediaChangeEvent)
axWindowsMediaPlayer1.currentPlaylist = axWindowsMediaPlayer1.cdromCollection.Item(e.cdromNum).Playlist
axWindowsMediaPlayer1.Ctlcontrols.play()
'this.textBox1.Text = axWindowsMediaPlayer1.currentMedia.getItemInfo("Name");
Me.textBox1.Text = ("Name: " & axWindowsMediaPlayer1.currentMedia.getItemInfo("Name")) + Environment.NewLine
Me.textBox1.Text += ("author: " & axWindowsMediaPlayer1.currentMedia.getItemInfo("author")) + Environment.NewLine
Me.textBox1.Text += ("Title: " & axWindowsMediaPlayer1.currentMedia.getItemInfo("Title")) + Environment.NewLine
Me.textBox1.Text += ("Album: " & axWindowsMediaPlayer1.currentMedia.getItemInfo("Album")) + Environment.NewLine
Me.textBox1.Text += ("copyright: " & axWindowsMediaPlayer1.currentMedia.getItemInfo("copyright")) + Environment.NewLine
Me.textBox1.Text += ("Artist: " & axWindowsMediaPlayer1.currentMedia.getItemInfo("Artist")) + Environment.NewLine
Me.textBox1.Text += ("Genre: " & axWindowsMediaPlayer1.currentMedia.getItemInfo("Genre")) + Environment.NewLine
Me.textBox1.Text += ("Bitrate: " & axWindowsMediaPlayer1.currentMedia.getItemInfo("Bitrate")) + Environment.NewLine
Me.textBox1.Text += ("Abstract: " & axWindowsMediaPlayer1.currentMedia.getItemInfo("Abstract")) + Environment.NewLine
Me.textBox1.Text += ("bitRate: " & axWindowsMediaPlayer1.currentMedia.getItemInfo("bitRate")) + Environment.NewLine
Me.textBox1.Text += ("duration: " & axWindowsMediaPlayer1.currentMedia.getItemInfo("duration")) + Environment.NewLine
End Sub
End Class
End Namespace
|
|
|
|