Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.IO;
- namespace Renamer
- {
- public partial class Form1 : Form
- {
- string readpath;
- string curruser = System.Environment.UserName;
- string directoryfile;
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- directoryfile = @"C:\Users\" + curruser + @"\Appdata\Local\fo4renamer\directory.txt";
- if (File.Exists(directoryfile))
- {
- DisplayText.Visible = false;
- InsertText.Visible = false;
- readpath = File.ReadAllText(directoryfile);
- }
- }
- private void InsertText_Click(object sender, EventArgs e)
- {
- string curruser = System.Environment.UserName;
- string fo4directory = DisplayText.Text;
- string path = Directory.GetCurrentDirectory();
- string target = path + @"\data";
- string directoryfile = @"C:\Users\" + curruser + @"\Appdata\Local\fo4renamer\directory.txt";
- string appdata = @"C:\Users\" + curruser + @"\Appdata\Local\fo4renamer";
- //Checks if the renamer folder exists and creates folder
- Directory.CreateDirectory(appdata);
- label1.Text = curruser;
- //writes to file
- TextWriter tw = new StreamWriter(directoryfile);
- tw.WriteLine(fo4directory);
- tw.Close();
- //set Label to the file output
- label1.Text = File.ReadAllText(directoryfile);
- DisplayText.Visible = false;
- InsertText.Visible = false;
- string readpath = File.ReadAllText(directoryfile);
- }
- private void ChangeDir_CheckedChanged(object sender, EventArgs e)
- {
- if (ChangeDir.Checked)
- {
- DisplayText.Visible = true;
- InsertText.Visible = true;
- }
- else
- {
- DisplayText.Visible = false;
- InsertText.Visible = false;
- }
- }
- private void French_CheckedChanged(object sender, EventArgs e)
- {
- if (French.Checked)
- {
- directoryfile = @"C:\Users\" + curruser + @"\Appdata\Local\fo4renamer\directory.txt";
- label1.Text = directoryfile;
- readpath = File.ReadAllText(directoryfile);
- string shouldwork = readpath + "data";
- string french = shouldwork + "\\french";
- string german = shouldwork + "\\german";
- string tmp = shouldwork + "tmp.txt";
- label1.Text = french;
- string path2 = @"C:\Users\duchacekda\Desktop\e\Renamer\Renamer\bin\Debug\tmp.txt";
- string filename = @"C:\Users\duchacekda\Desktop\e\Renamer\Renamer\bin\Debug\french.txt";
- File.Move(french, german);
- }
Advertisement
Add Comment
Please, Sign In to add comment