using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Xml;
namespace Shortcuts
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public string FileLocationToRun;
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog fdlg = new OpenFileDialog();
fdlg.Title = "Browse";
//fdlg.InitialDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.Recent);
fdlg.Filter = "All Files.* (*.*)|*.*";
fdlg.FilterIndex = 2;
fdlg.RestoreDirectory = true;
string fullpath = "";
if (fdlg.ShowDialog() == DialogResult.OK)
{
fullpath = System.IO.Path.GetFullPath(fdlg.FileName);
textBox1.Text = fullpath;
}
}
private void button2_Click_1(object sender, EventArgs e)
{
if (textBox1.Text.Equals("") | textBox2.Text.Equals(""))
{
MessageBox.Show("One of the required fields does not contain any text", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
dataGridView1.Rows.Add(textBox2.Text, textBox1.Text);
}
}
private void button3_Click(object sender, EventArgs e)
{
FileLocationToRun = dataGridView1.SelectedCells[1].Value.ToString();
Process.Start(FileLocationToRun);
}
private void button4_Click(object sender, EventArgs e)
{
}
private void button5_Click(object sender, EventArgs e)
{
}
}
}
thats my code so far, i need the datagridview to be able to save and load from a small file that i can preferably embed within the program.
Any help ?
thanks,