AnalysisEngine.Writer.setPath C# (CSharp) Method

setPath() public method

public setPath ( string s ) : void
s string
return void
        public void setPath(string s)
        {
            if (writer != null)
                writer.Close();

            path = s;
            if (!File.Exists(s))
            {
                writer = new StreamWriter(s);
                writer.Close();
            }
        }

Usage Example

Beispiel #1
0
        public AntiPwny()
        {
            icon = new NotifyIcon();
            icon.Text = "Antipwny";
            icon.Icon = new System.Drawing.Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("AnalysisEngine.Resources.icon.ico"));
            icon.ContextMenu = new ContextMenu();
            icon.ContextMenu.MenuItems.Add("Exit",OnExit);

            icon.DoubleClick += new EventHandler(ShowGui);
            icon.Visible = true;

            InitializeComponent();
            initializeGui();

            w = Writer.getInstance();
            w.LogAdded += HandleItemAdded;
            builder = new StringBuilder();

            w.setPath("output.txt");
            FileWatchers filewatch = new FileWatchers();
            regwatch = new RegistryWatchers();
            regwatch.addRegistry += regwatch_addRegistry;
            regwatch.removedEntry += regwatch_removedEntry;
            EventLogWatchers evt = new EventLogWatchers();
            proc = new ProcWatchers();
            rescanButton.Enabled = false;
            procListUpdater.RunWorkerAsync();
        }