Help for c#

Iniciado por r00ter, Noviembre 16, 2014, 09:12:04 AM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Noviembre 16, 2014, 09:12:04 AM Ultima modificación: Noviembre 16, 2014, 10:25:12 AM por blackdrake
I try to make a keygen for this license_control ... help me please ..


Código: csharp

using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using RedaX.My;
using System;
using System.Data.OleDb;
using System.IO;
using System.Management;
using System.Security.Cryptography;
using System.Text;
using System.Windows.Forms;

namespace RedaX
{
[StandardModule]
internal sealed class GenelModul
{
public static OleDbCommand Cmd;

public static System.Data.OleDb.OleDbConnection OleDbConnection;

public static string RedaXDataPath;

public static string WindowsTemp1;

public static string WindowsTemp2;

public static bool LisansKontrolEdildi;

public static DateTime RecDate;

public static bool LisansDurum;

public static DateTime LSonTar;

public static string LisansSahibi;

public static bool LisansBittiMi;

public static DateTime DateTimeNow;

static GenelModul()
{
GenelModul.RedaXDataPath = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "\\", Application.ProductName);
GenelModul.WindowsTemp1 = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Templates), "\\");
GenelModul.WindowsTemp2 = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "\\");
}

public static string App_Path()
{
return AppDomain.CurrentDomain.BaseDirectory;
}

public static void DataConnect()
{
if (!File.Exists(string.Concat(GenelModul.RedaXDataPath, "\\Data\\\\ozgundata.mdb")))
{
MyProject.Forms.frm_splash.Close();
Interaction.MsgBox("RedaX veritabanı hatası, Lütfen uygulamayı yeniden kurmayı deneyin!", MsgBoxStyle.Critical, "Veritabanı Hatası!");
ProjectData.EndApp();
}
else
{
GenelModul.OleDbConnection = new System.Data.OleDb.OleDbConnection()
{
ConnectionString = string.Concat("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=", GenelModul.RedaXDataPath, "\\Data\\\\ozgundata.mdb;Persist Security Info=False;Jet OLEDB:Database Password=SGmafZg4vspLr6Ek7y!?;")
};
GenelModul.OleDbConnection.Open();
GenelModul.Cmd = new OleDbCommand()
{
Connection = GenelModul.OleDbConnection
};
}
}

public static string GetFileContents(string FullPath, ref string ErrInfo = "")
{
string str = null;
try
{
StreamReader streamReader = new StreamReader(FullPath);
string end = streamReader.ReadToEnd();
streamReader.Close();
str = end;
}
catch (Exception exception)
{
ProjectData.SetProjectError(exception);
ErrInfo = exception.Message;
ProjectData.ClearProjectError();
}
return str;
}

public static string HDDSerial()
{
string str = null;
ManagementObjectCollection.ManagementObjectEnumerator enumerator = null;
using (ManagementObjectCollection managementObjectCollections = (new ManagementObjectSearcher("Select * from  Win32_LogicalDisk")).Get())
{
enumerator = managementObjectCollections.GetEnumerator();
if (enumerator.MoveNext())
{
ManagementObject current = (ManagementObject)enumerator.Current;
Conversions.ToString(current["Volumename"]);
string str1 = Conversions.ToString(current["Volumeserialnumber"]);
str = string.Format("{0}", str1);
}
}
return str;
}

public static object LisansBitti()
{
object obj = null;
GenelModul.SaveTextToFile(GenelModul.MD5("EXP"), string.Concat(GenelModul.WindowsTemp1, "rdxexp.wav"), "");
GenelModul.SaveTextToFile(GenelModul.MD5("EXP"), string.Concat(GenelModul.WindowsTemp2, "rdxexc.wav"), "");
MyProject.Forms.Form1.Enabled = false;
GenelModul.LisansBittiMi = true;
Interaction.MsgBox("RedaX Deneme Sürümü kullanım süresi sona ermiştir, RedaX'ı tam sürümde kullanmak için lisans anahtarı girmeniz gerekmektedir!", MsgBoxStyle.Critical, "Deneme Süresi Bitti!");
MyProject.Forms.frm_lisans.Show();
return obj;
}

public static object LisansKontrol()
{
object obj = null;
string str;
try
{
DateTime time = Daytime.GetTime();
DateTimeOffset now = DateTimeOffset.Now;
GenelModul.DateTimeNow = Conversions.ToDate(GenelModul.TarihFormatla(time + now.Offset));
}
catch (Exception exception)
{
ProjectData.SetProjectError(exception);
MyProject.Forms.frm_splash.Close();
Interaction.MsgBox("Lisans kontrolü yapılamıyor!, Lütfen internet bağlantınızın olduğundan emin olun!", MsgBoxStyle.Critical, "Lisans kontrolü yapılamadı!");
ProjectData.EndApp();
ProjectData.ClearProjectError();
}
if (File.Exists(string.Concat(GenelModul.WindowsTemp1, "rdxins.wav")))
{
str = "";
GenelModul.RecDate = Conversions.ToDate(GenelModul.TarihFormatla(Conversions.ToDate(GenelModul.GetFileContents(string.Concat(GenelModul.WindowsTemp1, "rdxins.wav"), ref str))));
GenelModul.LSonTar = Conversions.ToDate(GenelModul.TarihFormatla(DateAndTime.DateAdd(DateInterval.Day, 15, GenelModul.RecDate)));
}
else
{
GenelModul.SaveTextToFile(Conversions.ToString(DateTime.Today), string.Concat(GenelModul.WindowsTemp1, "rdxins.wav"), "");
GenelModul.RecDate = Conversions.ToDate(GenelModul.TarihFormatla(GenelModul.DateTimeNow));
GenelModul.LSonTar = DateAndTime.DateAdd(DateInterval.Day, 15, GenelModul.DateTimeNow);
}
if (File.Exists(string.Concat(GenelModul.WindowsTemp1, "rdxexp.wav")) | File.Exists(string.Concat(GenelModul.WindowsTemp2, "rdxexc.wav")))
{
GenelModul.LisansDurum = false;
GenelModul.LisansBitti();
}
else if (!File.Exists(string.Concat(GenelModul.RedaXDataPath, "\\libocat.bls")))
{
GenelModul.LisansDurum = false;
if (File.Exists(string.Concat(GenelModul.WindowsTemp1, "rdxins.wav")) && Operators.CompareString(GenelModul.TarihFormatla(File.GetCreationTime(string.Concat(GenelModul.WindowsTemp1, "rdxins.wav"))), GenelModul.TarihFormatla(GenelModul.RecDate), false) != 0)
{
GenelModul.LisansDurum = false;
GenelModul.LisansBitti();
}
else if (DateAndTime.DateDiff(DateInterval.Day, GenelModul.DateTimeNow, GenelModul.LSonTar, FirstDayOfWeek.Sunday, FirstWeekOfYear.Jan1) > (long)0)
{
GenelModul.LisansKontrolEdildi = true;
}
else
{
GenelModul.LisansBitti();
}
}
else
{
str = "";
string fileContents = GenelModul.GetFileContents(string.Concat(GenelModul.RedaXDataPath, "\\libocat.bls"), ref str);
string[] strArrays = Strings.Split(fileContents, ",", -1, CompareMethod.Binary);
if (Operators.CompareString(GenelModul.MD5(string.Concat(strArrays[0], GenelModul.TarihFormatla(GenelModul.RecDate), GenelModul.MD5(GenelModul.HDDSerial()))), strArrays[1], false) == 0)
{
GenelModul.LisansSahibi = strArrays[0];
GenelModul.LisansDurum = true;
GenelModul.LisansKontrolEdildi = true;
}
else
{
GenelModul.LisansDurum = false;
GenelModul.LisansBitti();
}
}
return obj;
}

public static string MD5(string yazi)
{
string str;
try
{
MD5CryptoServiceProvider mD5CryptoServiceProvider = new MD5CryptoServiceProvider();
byte[] bytes = Encoding.ASCII.GetBytes(yazi);
byte[] numArray = mD5CryptoServiceProvider.ComputeHash(bytes);
int num = checked((int)Math.Round((double)(checked(checked((int)numArray.Length) * 2)) + (double)(checked((int)numArray.Length)) / 8));
StringBuilder stringBuilder = new StringBuilder(num);
int length = checked(checked((int)numArray.Length) - 1);
for (int i = 0; i <= length; i++)
{
stringBuilder.Append(BitConverter.ToString(numArray, i, 1));
}
str = stringBuilder.ToString().TrimEnd(new char[] { ' ' });
}
catch (Exception exception)
{
ProjectData.SetProjectError(exception);
str = "0";
ProjectData.ClearProjectError();
}
return str;
}

public static bool SaveTextToFile(string strData, string FullPath, string ErrInfo = "")
{
bool flag = false;
try
{
StreamWriter streamWriter = new StreamWriter(FullPath);
streamWriter.Write(strData);
streamWriter.Close();
flag = true;
}
catch (Exception exception)
{
ProjectData.SetProjectError(exception);
ErrInfo = exception.Message;
ProjectData.ClearProjectError();
}
return flag;
}

public static string StringTemizle(string girdi)
{
return Strings.Replace(girdi, "'", "", 1, -1, CompareMethod.Binary);
}

public static string TarihFormatla(DateTime GirisTarih)
{
string str;
string str1;
int day;
if (Strings.Len(GirisTarih.Day.ToString()) != 2)
{
day = GirisTarih.Day;
str1 = string.Concat("0", day.ToString());
}
else
{
str1 = Conversions.ToString(GirisTarih.Day);
}
if (Strings.Len(GirisTarih.Month.ToString()) != 2)
{
day = GirisTarih.Month;
str = string.Concat("0", day.ToString());
}
else
{
str = Conversions.ToString(GirisTarih.Month);
}
string[] strArrays = new string[] { str1, ".", str, ".", null };
day = GirisTarih.Year;
strArrays[4] = day.ToString();
return string.Concat(strArrays);
}
}
}

you have to be a little more specific. whats your problem?
Web: No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
Igm: /secureart
Telegram: @roaddhdc
Correo: No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
Face: /roaddhdc
Twitter: @roaddhdc
Youtube: No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

r00ter, could you please explain your ploblem?


Ya lo encontre, su problema es que no conoshe cual es el problemillo jiji

Cuak!

El problema no es tu ausencia(8)

Web: No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
Igm: /secureart
Telegram: @roaddhdc
Correo: No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
Face: /roaddhdc
Twitter: @roaddhdc
Youtube: No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

Spoken English Area... Get Out Of Here, trolls. >:(