j.mendes24 Posted March 16, 2009 at 11:56 AM Report Share #250950 Posted March 16, 2009 at 11:56 AM ola bom dia, eu se tiver uma aplicação aberta consigo o a fechar, para isso utilizo o codigo seguinte: Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim p As Process For Each p In Process.GetProcesses() If p.ProcessName.ToLower() = "calculadora.exe" Then MsgBox("ahahah consegui tomaaaaaa") p.Kill() End If Next End Sub isto para terminar uma calculadora que esteja aberta ao clicar num botao. mas depois se eu a quizer iniciar ja nao da, eu utilizo o seguinte codigo: Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Process.Start("calculadora") ' inicia um executavel End Sub para abrir a calculador ao clicar num botao, mas ele dame erro na linha completa, o erro e o seguinte: "O sistema não conseguiu localizar o ficheiro especificado". mas ele se fecha tb devia abrir. por exemplo para o word eles ja faz bem. alguem me podia ajudar? Link to comment Share on other sites More sharing options...
Julia Posted March 16, 2009 at 12:31 PM Report Share #250955 Posted March 16, 2009 at 12:31 PM tenta ires pelo caminho ! Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Process.Start(EXEMPLO"c:\Programas\calculadora.exe") ' inicia um executavel End Sub Link to comment Share on other sites More sharing options...
jpaulino Posted March 16, 2009 at 12:47 PM Report Share #250957 Posted March 16, 2009 at 12:47 PM "calculadora" não existe, mas sim "calc" E não cries tópicos repetido ... o outro foi apagado! Link to comment Share on other sites More sharing options...
j.mendes24 Posted March 16, 2009 at 12:53 PM Author Report Share #250958 Posted March 16, 2009 at 12:53 PM e calculadora pk foi uma aplicação feita por mim em vb.net. Link to comment Share on other sites More sharing options...
nitty Posted March 16, 2009 at 02:23 PM Report Share #250968 Posted March 16, 2009 at 02:23 PM System.Diagnostics.Process.Start("C:\Programas\Microsoft Office\OFFICE12\WINWORD.exe") Link to comment Share on other sites More sharing options...
nitty Posted March 16, 2009 at 02:25 PM Report Share #250969 Posted March 16, 2009 at 02:25 PM Dsclpem o double post mas o que eu postei antes é um exemplo Link to comment Share on other sites More sharing options...
j.mendes24 Posted March 16, 2009 at 02:26 PM Author Report Share #250971 Posted March 16, 2009 at 02:26 PM eu o word consigo abrir. nao consigo e abrir a calculadora que fiz em vb.net. ja fiz setup e ja instalei. mas nao consigo abrir. da erro. tambem ja tentei por o caminho e da erro a mesma Link to comment Share on other sites More sharing options...
nitty Posted March 16, 2009 at 02:42 PM Report Share #250978 Posted March 16, 2009 at 02:42 PM Tenta por o .exe da calculadora que fizeste. ex: System.Diagnostics.Process.Start("C:\Programas\Calculadora\Calcvb.exe") acho q entendes assim Link to comment Share on other sites More sharing options...
j.mendes24 Posted March 16, 2009 at 02:56 PM Author Report Share #250980 Posted March 16, 2009 at 02:56 PM entendo, tambem ja o tinha feito e da erro. Link to comment Share on other sites More sharing options...
Hellblazer Posted March 16, 2009 at 03:03 PM Report Share #250982 Posted March 16, 2009 at 03:03 PM Penso que o erro diz tudo: "O sistema não conseguiu localizar o ficheiro especificado" There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
j.mendes24 Posted March 16, 2009 at 03:04 PM Author Report Share #250983 Posted March 16, 2009 at 03:04 PM yh isso mesmo. Link to comment Share on other sites More sharing options...
j.mendes24 Posted March 16, 2009 at 03:04 PM Author Report Share #250984 Posted March 16, 2009 at 03:04 PM mas eu meto o caminho correcto e nao da na mesma Link to comment Share on other sites More sharing options...
Hellblazer Posted March 16, 2009 at 03:06 PM Report Share #250985 Posted March 16, 2009 at 03:06 PM e dá exactamente o mesmo erro? There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
nitty Posted March 16, 2009 at 03:08 PM Report Share #250986 Posted March 16, 2009 at 03:08 PM Nao terás q adicionar umas dll ou assim? ? Link to comment Share on other sites More sharing options...
Hellblazer Posted March 16, 2009 at 03:11 PM Report Share #250987 Posted March 16, 2009 at 03:11 PM http://www.thescarms.com/dotnet/Process.aspx There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
j.mendes24 Posted March 16, 2009 at 03:12 PM Author Report Share #250988 Posted March 16, 2009 at 03:12 PM yh exactamente o mesmo erro. acho que nao tenho que por ninhuma dll. pk se eu abrir um jogo qualquer ele abre, mas a calculadora não. Link to comment Share on other sites More sharing options...
nitty Posted March 16, 2009 at 03:14 PM Report Share #250989 Posted March 16, 2009 at 03:14 PM entao nao sei mesmo eu abri um topico sobre o mdi q o qeria por diferente,ou seja, com outro interface e tambem ainda estou nisso,bloqeado mesmo Link to comment Share on other sites More sharing options...
jpaulino Posted March 16, 2009 at 06:23 PM Report Share #251029 Posted March 16, 2009 at 06:23 PM yh exactamente o mesmo erro. acho que nao tenho que por ninhuma dll. pk se eu abrir um jogo qualquer ele abre, mas a calculadora não. Mostra lá código que usaste ? Link to comment Share on other sites More sharing options...
j.mendes24 Posted March 17, 2009 at 02:29 PM Author Report Share #251221 Posted March 17, 2009 at 02:29 PM Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim p As Process For Each p In Process.GetProcesses() If p.ProcessName.ToLower() = "calculadora.exe" Then MsgBox("ahahah consegui tomaaaaaa") p.Kill() End If Next End Sub isto para terminar uma calculadora que esteja aberta ao clicar num botao. mas depois se eu a quizer iniciar ja nao da, eu utilizo o seguinte codigo: Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Process.Start("calculadora") ' inicia um executavel End Sub para abrir a calculador ao clicar num botao, mas ele dame erro na linha completa, o erro e o seguinte: "O sistema não conseguiu localizar o ficheiro especificado". mas ele se fecha tb devia abrir. por exemplo para o word eles ja faz bem. Link to comment Share on other sites More sharing options...
jpaulino Posted March 17, 2009 at 06:33 PM Report Share #251336 Posted March 17, 2009 at 06:33 PM Mas já experimentaste como a nitty disse ? Indicar o caminho completo. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now