Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 07-08-2017
carlosprotos carlosprotos is offline
Miembro
 
Registrado: abr 2014
Posts: 28
Poder: 0
carlosprotos Va por buen camino
Talking Código fuente de VB a Delphi

Me gustaria saber como podria poner este codigo fuente de VB a Delphi en un timer.
Alguien podria ayudarme. No soy bueno en delphi y desconosco las diferencias y modulos.

Código:
Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Drawing
Imports System.IO
Imports System.Runtime.CompilerServices
Imports System.Windows.Forms
Imports System.Environment
Imports Microsoft.Win32
Código:
  Try
            Dim folderPath As String = Environment.GetFolderPath(SpecialFolder.Windows)
            FileSystem.FileClose(New Integer() {1})
            FileSystem.FileClose(New Integer() {2})
            If My.Computer.FileSystem.FileExists((folderPath & "\xspirit.sys")) Then
                FileSystem.FileOpen(1, (folderPath & "\xspirit.sys"), OpenMode.Append, OpenAccess.ReadWrite, OpenShare.LockReadWrite, -1)

            Else
                File.WriteAllBytes((folderPath & "\xspirit.sys"), New Byte() {0})
                FileSystem.FileOpen(1, (folderPath & "\xspirit.sys"), OpenMode.Append, OpenAccess.ReadWrite, OpenShare.LockReadWrite, -1)

            End If
            If My.Computer.FileSystem.FileExists((folderPath & "\xhunter1.sys")) Then
                FileSystem.FileOpen(2, (folderPath & "\xhunter1.sys"), OpenMode.Append, OpenAccess.ReadWrite, OpenShare.LockReadWrite, -1)

            Else
                File.WriteAllBytes((folderPath & "\xhunter1.sys"), New Byte() {0})
                FileSystem.FileOpen(2, (folderPath & "\xhunter1.sys"), OpenMode.Append, OpenAccess.ReadWrite, OpenShare.LockReadWrite, -1)

            End If
        Catch exception1 As Exception
            ProjectData.SetProjectError(exception1)
            Dim ex As Exception = exception1
            ProjectData.SetProjectError(ex)
            Dim exception As Exception = ex
            ProjectData.ClearProjectError()
            ProjectData.ClearProjectError()
        End Try
por favar :v
Responder Con Cita
  #2  
Antiguo 07-08-2017
darkamerico darkamerico is offline
Miembro
 
Registrado: dic 2010
Posts: 225
Poder: 14
darkamerico Va por buen camino
Wink Saludos

Dale una chequeada a este hilo: https://www.clubdelphi.com/foros/showthread.php?t=68379

saludos
Responder Con Cita
  #3  
Antiguo 08-08-2017
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.233
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Para obtener directorios de sistema puedes revisar estos hilos:
http://www.clubdelphi.com/~marcsc/fo...ad.php?t=26419

Para comprobar si un fichero existe, tienes la función FileExists de la unit System.SysUtils; Aquí tienes la ayuda:
http://docwiki.embarcadero.com/Libra...ils.FileExists

En es misma unit, encontrarás muchos otros procedimientos útiles sobre ficheros:
http://docwiki.embarcadero.com/Libra...Utils#Routines

Para abrir un fichero, tal y como se hare en el ejemplo que has puesto, aquí tienes los procedimientos que se usan:
http://docwiki.embarcadero.com/RADSt...Output_Support
Y aquí, por ejemplo, tienes código de ejemplo de cómo utilizarlas:
http://docwiki.embarcadero.com/CodeE...Append_(Delphi)
http://docwiki.embarcadero.com/CodeE...ckRead_(Delphi)
http://docwiki.embarcadero.com/CodeE...ewrite_(Delphi)
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Código fuente de la Cara Oculta de Delphi 6 de Ian Marteens tuni Varios 10 27-07-2015 15:42:30
Convertir este código fuente the CSharp a Delphi Blade_Is_One .NET 0 20-12-2012 15:59:51
ANN: AnyNET-Delphi: Herramienta para generar codigo fuente Delphi desde :NET mamcx Noticias 7 21-05-2007 03:12:36
codigo fuente o programa en delphi Ravent OOP 5 27-05-2006 17:04:33
Codigo fuente de C en compilacion con Delphi JXJ Varios 3 11-04-2006 22:50:36


La franja horaria es GMT +2. Ahora son las 21:56:16.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi