예제 #1
0
        private void OnBtnSaveAsClicked(object sender, EventArgs a)
        {
            LogSaveDialog lsd = new LogSaveDialog();

            if (lsd.Run() == ResponseType.Ok)
            {
                string filename = lsd.Filename;

                // Si no tiene extensión se la añadimos.

                if (!System.IO.Path.HasExtension(filename))
                {
                    filename += ".log";
                }

                // Guardamos

                using (FileStream file = new FileStream(filename, FileMode.Create))
                {
                    StreamWriter writer = new StreamWriter(file);
                    writer.Write(txtLog.Buffer.Text);
                    writer.Close();
                }
            }

            lsd.Destroy();
        }
예제 #2
0
		private void OnBtnSaveAsClicked(object sender, EventArgs a)
		{
		    LogSaveDialog lsd = new LogSaveDialog();
		    if(lsd.Run() == ResponseType.Ok)
		    {
		    	string filename = lsd.Filename;
		    	
		    	// Si no tiene extensión se la añadimos.
		    	
		    	if(!System.IO.Path.HasExtension(filename))
		    	{
		    		filename += ".log";
		    	}
		    	
		    	// Guardamos
		    	
		    	using(FileStream file = new FileStream(filename, FileMode.Create))
		    	{
		    		StreamWriter writer = new StreamWriter(file);
		    		writer.Write(txtLog.Buffer.Text);
		    		writer.Close();
		    	}
		    	
		    }
		    
		    lsd.Destroy();
		}