Alright this should do it. I'm not familiar with MySQL so do the corrections on classes/mysql syntax. I've provided you with a simple account transfer, there is also a really really simple ini class.
PHP Code:
public static void TransferAccounts(string Table) {
MySqlCommand Command = MySqlCommand("SELECT * FROM `Table`");
MySqlDataReader DR = Command.ExecuteReader(); // Or something similar.
while(DR.Read()) {
// These are just examples. We're 'trimming' them incase there is white spaces.
string Username = (DR["Username"] as string).Trim();
string Password = (DR["Password"] as string).Trim();
IniFile iFile = new IniFile("D:\\ConquerServer\\Database\\Accounts\\" + Username + ".ini");
if(!iFile.Exists) {
// Assuming that we don't want to override any existing accounts.
iFile.WriteString("Accounts", "Username", Username);
iFile.WriteString("Accounts", "Password", Password);
}
}
DR.Close();
}
PHP Code:
class IniFile
{
[DllImport("kernel32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
private static extern int GetPrivateProfileStringA(string Section, string Key, string Default, StringBuilder Buffer, int BufferSize, string FileName);
[DllImport("kernel32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
private static extern int WritePrivateProfileStringA(string Section, string Key, string Value, string FileName);
private string Location;
private bool Found;
public IniFile(string Location)
{
this.Location = Location;
this.Found = File.Exists(Location);
}
public bool Exists { get { return Found; } }
public void WriteString(string Section, string Key, string Value)
{
WritePrivateProfileStringA(Section, Key, Value, Location);
}
}