private void ProcessTextfiles() { ////again: try { string userDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); //C:\Users\Georg\OneDrive\OutlookHelper dict = FileUtilities.ParseFileEx(userDir + @"\OneDrive\OutlookHelper\Roles.txt"); roles = FileUtilities.ParseFile(userDir + @"\OneDrive\OutlookHelper\Roles.txt"); cities = FileUtilities.ParseFile(userDir + @"\OneDrive\OutlookHelper\Cities.txt"); string resumeFilename = userDir + @"\OneDrive\Resumes\vp.docx"; string tempFilename = userDir + @"\OneDrive\Resumes\georgelockwoodresume.docx"; //System.IO.FileAttributes attribute = System.IO.FileAttributes.ReadOnly & System.IO.FileAttributes.Archive; System.IO.File.SetAttributes(tempFilename, ~System.IO.FileAttributes.ReadOnly); System.IO.File.Delete(tempFilename); /* * if( !System.IO.File.Exists( tempFilename ) ) * throw new Exception( string.Format( "the {0} file is missing", resumeFilename ) ); */ System.IO.File.Copy(resumeFilename, tempFilename, true); //System.IO.File.SetAttributes( tempFilename, attribute ); //System.IO.File.SetAttributes( tempFilename, attribute ); //jobEmailResponce = new JobEmailResponce( userDir + @"\OneDrive\OutlookHelper\outgoingmessage.txt", userDir + @"\OneDrive\Resumes\vp.docx", roles ); jobEmailResponce = new JobEmailResponce(userDir + @"\OneDrive\OutlookHelper\outgoingmessage.txt", tempFilename, roles); string path = userDir + @"\OneDrive\OutlookHelper\OutlookLite.json";// Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData ) + @"\OutlookLite"; this.htmlHelperData = HTMLHelperData.SetupHtmlHelper(path); //this.htmlHelperData = // } //catch (Exception x) catch { //MessageBox.Show( x.Message ); } //goto again; // }
public static HTMLHelperData SetupHtmlHelper(string filepath) { if (System.IO.File.Exists(filepath)) { //again: try { string text = System.IO.File.ReadAllText(filepath); HTMLHelperData htmlHelperData = Newtonsoft.Json.JsonConvert.DeserializeObject <HTMLHelperData>(text); return(htmlHelperData); } catch (Exception) { //throw ex; } // //goto again; } return(null); // }