|
Shell("C:\Program Files\Windows Media Player\wmplayer.exe e:\MSAJAX-ToDoList.wmv", AppWinStyle.MaximizedFocus, False)
|
|
|
|
|
thnx
Ahmed El-Badry
|
|
|
|
|
Hi,
I am new to vb dot net remoting i have some problem in that. The problem is i couldnt activate client exe over lan and its spitting some error(unhandled excpetion) while invoking that application. The activity of the client is to get some data (as dataset) from the database. But it work smoothly when there is not database connectivity.
But its working perfectly in the developed machine, which means both client and server are in the same machine. Can anyone guide me to rectify my problem? If i could get some sample code that will be usefull for me too.
Thanks
Karthi
sadsadfsasdfasdfadsfasdfasdfadsfasdf
|
|
|
|
|
I have created a program that lists all the processes running on the computer by using getprocesses then i have used a loop to list them all
For each process
Next
Then i have made it so that each process is listed in a listview object.
The problem i am having though is that i need to be able to use the process.kill method to exit the process that has been selected.
How would i do this?
If it is possible can you provide an example?
Could i use the process.mainmodule.filename(This just provides the filename/command line for the mainmodule of the program which is the process itself) then give the filename(From the process.mainmodule.filename) to process.startinfo.filename.
Then use the process.kill method, to exit the process?
Any help would be much appreciated
Thankyou!
A*****
|
|
|
|
|
you can use this API function:
Private Declare Function TerminateProcess Lib "kernel32" Alias "TerminateProcess" (ByVal hProcess As Integer, ByVal uExitCode As Integer) As Integer
for an example of what you want you can see this link:
Terminate a process immediately in VB.NET[^]
|
|
|
|
|
This should help. I'm using VS2005 so I hope this will be the same for you.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Get the processes with the name 'qryspree'
'You probably stored the process name in the listview so whatever item is selected
'will tell you the process name to get
Dim proc() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcessesByName("qryspree")
'Loop through processes found
'Note: Finding a process by name returns an array so the loop just
'ensures you kill each one with that name
For Each instance As System.Diagnostics.Process In proc
instance.Kill()
Next
End Sub
As another option you could store the process id's when you add them to the listview. The process object will tell you the ID. You could store the name with the id in a hashtable.
|
|
|
|
|
I had another idea. Why not store the ID as a subitem in the listview. Here is an example.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListView1.View = View.Details
ListView1.Columns.Add("Process", 150)
ListView1.Columns.Add("ID", 75)
'---Popullate listview1 with running processes
For Each proc As System.Diagnostics.Process In System.Diagnostics.Process.GetProcesses
'Add ProcessName with a subitem as the ID
ListView1.Items.Add(proc.ProcessName).SubItems.Add(proc.Id)
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each item As ListViewItem In ListView1.SelectedItems
MsgBox(item.SubItems(1).text)
Next
End Sub
End Class
|
|
|
|
|
Could anyone supply me a code in VB.net to read the data of a barcode scanner via a serial port.
Thanks for helping!
|
|
|
|
|
VB.NET 2005 does have a class for reading the serial port, I think, but the most likely solution will be a driver that comes with the barcode scanner.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
It is the same as any serial device typically the drivers are only for a USB serial that emulates a keyboard wedge or rs232. The microsoft sample code will work. Just read bytes on the datarecieved event and look for the end of string; it is typically setup in the reader as CR. Good luck!
|
|
|
|
|
how can i read the header file in vb.net2005
i need to read the avi header file
|
|
|
|
|
|
Thank you very much but is it in vb.net?
how can i import it's dll into vb.net?
|
|
|
|
|
I have sample form with 2 buttons one is Play Movie and other is Exit when i click on button Play Movie it starts up windows media player and plays a movie and when i press exit it exits a application. So what i need is that it can be run without Framework is this possible or i have to install Visual Basic 6 again? Please answer... Thanks
|
|
|
|
|
If u have developed your application using .net framework, you should install .net framework to make it usable.
|
|
|
|
|
hmmmmmmmmmmmmmmm so
how i develop my application without framework?
|
|
|
|
|
Visual C++
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i don't like structure of that language...
|
|
|
|
|
You asked...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
well anyway thanks Dave...
|
|
|
|
|
You've been around here long enough to know the answer to this.
No, you can't leave out the .NET Framework. It's a requirement for every Managed Code application you want to run. The sole exception to this is if your application is run through something like Thinstall[^]. But, be prepared to shell out big money for this little gem, and others like it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I answered this, I wonder where my answer disappeared to.
It's amazing to me that people use the framework, then assume we're all installing it for a joke, and it's not *really* needed.
I confirmed Seattle today, how about you ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: I answered this, I wonder where my answer disappeared to.
It's amazing to me that people use the framework, then assume we're all installing it for a joke, and it's not *really* needed.
He's been around long enough to know better too...
Christian Graus wrote: I confirmed Seattle today, how about you
It's not looking good. I'm still trying to get confirmation on some project details, scheduling specifically. You know how that goes...everything written in Jello until the last possible minute.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: You know how that goes...everything written in Jello until the last possible minute
Yeah, I wasn't confirmed until today, even now, it's not set in stone.
That sucks, it would have been cool to catch up.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
There's a kick off meeting this afternoon. Hopefully, some usable information comes out of it and I can get a better idea of what's going on this month and next.
Did I mention I hate Government jobs?
Christian Graus wrote: That sucks, it would have been cool to catch up.
Well, if it doesn't work out this time, there's always next year, or whenever your in Toronto. It's only about 270 miles away! It wouldn't take much prodding of the wife to get a weekend trip out of her.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|