Ir para conteúdo
Fórum Script Brasil

cnkruger

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

Tudo que cnkruger postou

  1. cnkruger

    Classe PHP + Ajax

    Bom Dia, Tem como executar um método php com Ajax? Todos os tutoriais que encontro é setado o arquivo php, gostaria de saber se posso setar uma método, por exemplo: Ao invés de cliente_incluir.php, setar ClienteController::incluir($cliente); É possível? Grato, Cristhian
  2. Bom Dia a todos, Alguém sabe como pode ser simplificado o código abaixo? É possível fazer a mesma coisa com System.Diagnostics.Process? Busquei em vários lugares mas só encontro instruções separadas e não consegui juntar tudo, o código abaixo fui tirando de vários sites e de um código em vb6. Desde já agradeço a atenção de todos. <StructLayout(LayoutKind.Sequential)> Public Structure PROCESS_INFORMATION Public hProcess As IntPtr Public hThread As IntPtr Public dwProcessID As UInteger Public dwThreadID As UInteger End Structure 'PROCESS_INFORMATION <StructLayout(LayoutKind.Sequential)> Public Structure SECURITY_ATTRIBUTES Public nLength As Integer Public lpSecurityDescriptor As IntPtr Public bInheritHandle As Boolean End Structure 'SECURITY_ATTRIBUTES <StructLayout(LayoutKind.Sequential)> _ Public Structure STARTUPINFO Public cb As UInteger Public lpReserved As String Public lpDesktop As String Public lpTitle As String Public dwX As UInteger Public dwY As UInteger Public dwXSize As UInteger Public dwYSize As UInteger Public dwXCountChars As UInteger Public dwYCountChars As UInteger Public dwFillAttribute As UInteger Public dwFlags As UInteger Public wShowWindow As Short Public cbReserved2 As Short Public lpReserved2 As IntPtr Public hStdInput As IntPtr Public hStdOutput As IntPtr Public hStdError As IntPtr End Structure 'STARTINFO <DllImport("kernel32.dll")> _ Function CreateProcess( _ ByVal lpApplicationName As String, _ ByVal lpCommandLine As String, _ ByVal lpProcessAttributes As IntPtr, _ ByVal lpThreadAttributes As IntPtr, _ ByVal bInheritHandles As Boolean, _ ByVal dwCreationFlags As UInteger, _ ByVal lpEnvironment As IntPtr, _ ByVal lpCurrentDirectory As String, _ ByRef lpStartupInfo As STARTUPINFO, _ ByRef lpProcessInformation As PROCESS_INFORMATION) As Boolean End Function <DllImport("kernel32.dll")> _ Function WaitForSingleObject( _ ByVal hHandle As Long, _ ByVal dwMilliseconds As Long) As Long End Function <DllImport("kernel32.dll")> _ Function CloseHandle( _ ByVal hObject As Long) As Long End Function <DllImport("kernel32.dll")> _ Function TerminateProcess( _ ByVal ApphProcess As Long, _ ByVal uExitCode As Long) As Long End Function Private INFINITE As Integer = &HFFFFFFFF Private exitCode As Long Public Function ExecCmd(ByVal cmdline As String) As Long Dim proc As PROCESS_INFORMATION Dim start As STARTUPINFO Dim ret As Object Dim id As Long 'Inicia a strutura STARTUPINFO start.cb = Marshal.SizeOf(start) 'Inicia a aplicação escolhida para ser executada ret = CreateProcess(0&, cmdline, 0&, 0&, 1&, &H20, 0&, 0&, start, proc) id = proc.dwProcessID 'Aguarda a aplicação iniciada terminar ret = WaitForSingleObject(proc.hProcess, INFINITE) ret = CloseHandle(proc.hProcess) Return id End Function
×
×
  • Criar Novo...