Hej Lykkemark,
Det er jo den helt rigtige indstilling og du har ret arbejdet med at flytte profildata (brugernavne mv er flyttet) er sikkert et stort arbejde, jeg har dog valgt at få trådene over så hurtigt så muligt, så havde jeg tænkt mig at lukke det gamle forum ned,dog stadig læsbart så man kan klippe/klistre alt det man måtte lyste. Hvis du har lyst til at give en hånd er du mere end velkommen.
Man kan allerede ny rekvirere nyt kodeord på
www.club-corvette.dk/ccdforum/forums/login.php og logge ind for at teste det nye forum, det er email-adressen som er nøglen. De gamle kodeord kunne læses direkte i databasen, de nye er krypteret og man kan derfor ikke flytte kodeordene med over. Man kan så prøve at lave nogle testtråde mv, men alt i forum bliver slettet igen når det bliver overført fra det gamle.
Programmet til at lave brugedata ser sådan ud (der skal bla. konverteres til unix-dato, det er håndskrevet så det tager lige et øjeblik :-)
using System;
using System.IO;
using System.Text;
namespace userexport
{
///
/// Summary description for Class1.
///
class Class1
{
///
/// The main entry point for the application.
///
static void Main(string[] args)
{
/// vbulletin field pos
int userid = 00;
int usergroupid = 01;
int membergroupids = 02;
int displaygroupid = 03;
int username = 04;
int password = 05;
int passworddate = 06;
int email = 07;
int styleid = 08;
int parentemail = 09;
int homepage = 10;
int icq = 11;
int aim = 12;
int yahoo = 13;
int msn = 14;
int skype = 15;
int showvbcode = 16;
int showbirthday = 17;
int usertitle = 18;
int customtitle = 19;
int joindate = 20;
int daysprune = 21;
int lastvisit = 22;
int lastactivity = 23;
int lastpost = 24;
int lastpostid = 25;
int posts = 26;
int reputation = 27;
int reputationlevelid = 28;
int timezoneoffset = 29;
int pmpopup = 30;
int avatarid = 31;
int avatarrevision = 32;
int profilepicrevision = 33;
int sigpicrevision = 34;
int options = 35;
int birthday = 36;
int birthday_search = 37;
int maxposts = 38;
int startofweek = 39;
int ipaddress = 40;
int referrerid = 41;
int languageid = 42;
int emailstamp = 43;
int threadedmode = 44;
int autosubscribe = 45;
int pmtotal = 46;
int pmunread = 47;
int salt = 48;
int ipoints = 49;
int infractions = 50;
int warnings = 51;
int infractiongroupids = 52;
int infractiongroupid = 53;
int adminoptions = 54;
int profilevisits = 55;
int friendcount = 56;
int friendreqcount = 57;
int vmunreadcount = 58;
int vmmoderatedcount = 59;
int socgroupinvitecount = 60;
int socgroupreqcount = 61;
int pcunreadcount = 62;
int pcmoderatedcount = 63;
int gmmoderatedcount = 64;
/// importfile/data field count
int ID = 00;
int Firstname = 01;
int Lastname = 02;
int EmailAddress = 03;
int UserName = 04;
int Password = 05;
int Membernumber = 06;
int DateOfCreation = 07;
int MessageCount = 08;
int LoginCount = 09;
int Website = 10;
int LastLogin = 11;
int Admin = 12;
int Editor = 13;
int Member = 14;
int Deleted = 15;
// vbulleting def
string[] arInfo = new string;
char[] splitter = {';'};
// import file def
string[] arInfo1 = new string;
char[] splitter1 = { ';' };
// vbullletin file used as template (create one user for use as default/template).
string file_name = @';C:DataVisual Studio ProjectsuserexportbinDebuguser.csv';;
//sr As StreamReader = New StreamReader(';TestFile.txt';)
//fileStream = new StreamReader(fileInfo.OpenRead(), Encoding.GetEncoding(1252), true);
StreamReader freader = File.OpenText( file_name );
string t;
// find default user/template user
while ((t = freader.ReadLine()) != null)
{
arInfo = t.Split(splitter);
if (arInfo
== ';postmand';) break;
}
StreamWriter sw = new StreamWriter(';vbulletin.txt';);
using (StreamReader sr = new StreamReader(@';c:www.club-corvette.dktblUsers.txt';, Encoding.GetEncoding(1252), true))
{
string line;
// Read and display lines from the file until the end of
// the file is reached.
Int16 Userids = 0;
while ((line = sr.ReadLine()) != null)
{
arInfo1 = line.Split(splitter1);
arInfo = Userids.ToString();
arInfo[email] = arInfo1[EmailAddress];
arInfo = arInfo1;
arInfo = arInfo1;
arInfo = arInfo1;
arInfo = convertdate(arInfo1);
arInfo = convertdate(arInfo1);
sw.WriteLine(String.Join(@';;';, arInfo));
Userids += 1;
//if (Userids > 200) return;
}
}
sw.Close();
return;
}
public static string convertdate(string inputdate)
{
String s = ';';;
if (inputdate.Length > 0)
{
DateTime UnixBegin = new DateTime(1970, 1, 1);
DateTime outputdate = DateTime.Parse(inputdate);
long elapsedTicks = outputdate.Ticks - UnixBegin.Ticks;
TimeSpan elapsedSpan = new TimeSpan(elapsedTicks);
double numberofseconds = elapsedSpan.TotalSeconds;
s = numberofseconds.ToString();
}
return s;
}
}
}