function readData(filename){
var absolutePath = getAbsolutePath();
filename = absolutePath + filename;
var fso = new ActiveXObject("Scripting.FileSystemObject");
if(!fso.FileExists(filename))
{
file = fso.createtextfile(filename, true);
}
var file = fso.OpenTextFile(filename,1);
var familyObject = {};
while (!file.AtEndOfStream)
{
var data = file.ReadLine().toString();
var homeArray = data.split(":");
//如果家族树中已存在某家庭,则在家族树中push当前成员,否则创建家庭并加入该成员
if(familyObject[homeArray[0]])
{
familyObject[homeArray[0]].push(homeArray[1]);
}
else
{
familyObject[homeArray[0]] = [homeArray[1]];
}
}
file.Close();
return familyObject;
}
var absolutePath = getAbsolutePath();
filename = absolutePath + filename;
var fso = new ActiveXObject("Scripting.FileSystemObject");
if(!fso.FileExists(filename))
{
file = fso.createtextfile(filename, true);
}
var file = fso.OpenTextFile(filename,1);
var familyObject = {};
while (!file.AtEndOfStream)
{
var data = file.ReadLine().toString();
var homeArray = data.split(":");
//如果家族树中已存在某家庭,则在家族树中push当前成员,否则创建家庭并加入该成员
if(familyObject[homeArray[0]])
{
familyObject[homeArray[0]].push(homeArray[1]);
}
else
{
familyObject[homeArray[0]] = [homeArray[1]];
}
}
file.Close();
return familyObject;
}