Ejemplo n.º 1
0
        public int insertFile()
        {
            DBFileManagerDataContext db = new DBFileManagerDataContext();
            myfile mf = new myfile();

            mf.code      = this.p_code;
            mf.file_loca = this.p_loca;
            mf.create_at = this.p_date;
            db.myfiles.InsertOnSubmit(mf);
            db.SubmitChanges();
            return(0);
        }
Ejemplo n.º 2
0
        public static string[] getPubickeys(string file)
        {
            string filePath = System.IO.Directory.GetCurrentDirectory() + "\\encryptdocs\\" + file;

            filePath = filePath.Replace("\\", @"\");
            DBFileManagerDataContext db = new DBFileManagerDataContext();
            var    public_Keys_id       = from table in db.myfiles where table.file_loca == filePath select table;
            string code = public_Keys_id.First().code.ToString();
            string path = public_Keys_id.First().file_loca.ToString();

            string[] result = { code, path };
            return(result);
        }