Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > .NET
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 20-12-2012
Blade_Is_One Blade_Is_One is offline
Registrado
 
Registrado: nov 2006
Posts: 3
Poder: 0
Blade_Is_One Va por buen camino
Question Convertir este código fuente the CSharp a Delphi

Hola a todos, hace mucho que no volvia a estos foros ,
ahora que estoy en un nuevo proyecto necesito de su ayuda , alguien que me pueda ayudar a traspasar este fuente que esta en C# a delphi (uso delphi7) se los agradeceria mucho...

Código PHP:
public static class VoiceCode
{
    public static 
string Compute(string GTINstring lotDateTimepackDate)
    {
        
ushort crc Crc16.ComputeChecksum(Encoding.ASCII.GetBytes(string.Format("{0}{1}{2}"GTINlotpackDate.HasValue packDate.Value.ToString("yyMMdd") :
        
string.Empty))); return string.Format("{0:0000}"crc 10000);
    }
}


public static class 
Crc16 #region static members
    
private const ushort polynomial 0xA001; private static ushort[] table = new ushort[256]; static Crc16()
    {
        
ushort valueushort temp;
        for (
ushort i 0table.Length; ++i) {
            
value 0;
            
temp i; for (byte j 08; ++j) {
            if (
!= ((value temp) & 0x0001)) {
                
value = (ushort)((value >> 1) ^ polynomial);
            }     else {
                          
value >>= 1; } temp >>= 1;
                       }
            
table[i] = value;
        }
    } 
#endregion

    
public static ushort ComputeChecksum(byte[] bytes) { ushort crc 0;
         for (
int i 0bytes.Length; ++i) {
             
byte index = (byte)(crc bytes[i]);
             
crc = (ushort)((crc >> 8) ^ table[index]);
         } return 
crc;
    }

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
Codigo de CSharp a Delphi jhonny Varios 5 29-08-2007 02:46:20
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
Guardar codigo fuente HTML desde delphi dmassive Internet 7 07-03-2004 23:32:05


La franja horaria es GMT +2. Ahora son las 19:57:34.


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