public override object Run(Hashtable xc) { string filepath = xc.GetCSVariable <object>("filepath").ToString(); string mode = xc.GetCSVariable <object>("mode").ToString(); FileMode fmode; switch (mode) { case "open": fmode = FileMode.Open; break; case "creat": fmode = FileMode.Create; break; case "append": fmode = FileMode.Append; break; default: throw new Exceptions.RunException(Exceptions.EXID.参数错误, "无对应参数"); } if (GIInfo.Platform == "Mac_Xamarin") { filepath = filepath.Replace("\\", "/"); } GI.GStream stream = new GStream(new FileStream(filepath, fmode)); return(new Variable(stream)); }
public override object Run(Hashtable xc) { string gaaname = xc.GetCSVariable <object>("gaaname").ToString(); string filepath = xc.GetCSVariable <object>("filepath").ToString(); GI.GStream stream = new GStream(GI.GStream.gaas[gaaname].GetEntry(gaaname + "/file/" + filepath).Open()); return(new Variable(stream)); }