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.Windows.Forms;
- using System.IO;
- using MySql.Data.MySqlClient;
- using System.Diagnostics;
- using System.Threading;
- private void browseFilesToolStripMenuItem_Click(object sender, EventArgs e)
- {
- groupBox2.Visible = false;
- groupBox1.Visible = true;
- browseFilesToolStripMenuItem.Enabled = false;
- openFileDialog1.Filter = ".ssd Files Only|*.ssd;";
- openFileDialog1.FilterIndex = 1;
- openFileDialog1.Multiselect = true;
- openFileDialog1.Title = "Open SSD Files";
- if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- timer2.Enabled = true;
- if (openFileDialog1.FileNames.Length > 0 && openFileDialog1.FileNames.Length < 500)
- {
- int filecounter = 0;
- label6.Text = openFileDialog1.FileNames.Length.ToString();
- label7.Text = openFileDialog1.FileNames.Length.ToString();
- int defsec = openFileDialog1.FileNames.Length * 5;
- TimeSpan t = TimeSpan.FromSeconds(defsec);
- string answer = string.Format("{0:D2}h:{1:D2}m:{2:D2}s",
- t.Hours,
- t.Minutes,
- t.Seconds);
- label23.Text = answer;
- foreach (String file in openFileDialog1.FileNames)
- {
- Thread.Sleep(2000);
- label9.Text = file;
- try
- {
- String user = textBox2.Text;
- String date = File.ReadAllLines(label9.Text)[1].Split(' ')[3].Replace(".", "-");
- String time = File.ReadAllLines(label9.Text)[1].Split(' ')[4].Remove(8);
- time = time.TrimEnd('.');
- String latt = File.ReadAllLines(label9.Text)[3].Split(' ')[1].Split(']')[1];
- latt = latt.Remove(latt.Length - 1);
- String longi = File.ReadAllLines(label9.Text)[5].Split(' ')[1].Split(']')[1];
- longi = longi.Remove(longi.Length - 1);
- String depth = File.ReadAllLines(label9.Text)[6].Split(']')[1];
- depth = depth.Trim();
- String xmagcheck = File.ReadAllLines(label9.Text)[11];
- String xmag;
- if (xmagcheck.Contains("#CHANNEL"))
- {
- xmag = File.ReadAllLines(label9.Text)[10].Split(' ')[1].Split('=')[1];
- }
- else
- {
- xmag = File.ReadAllLines(label9.Text)[11].Split(' ')[1].Split('=')[1];
- }
- string connString ="***";
- MySqlCommand command = conn.CreateCommand();
- command.CommandText = ****;
- textBox6.Text += command.CommandText.ToString() + "\r\n";
- conn.Open();
- command.ExecuteNonQuery();
- filecounter++;
- conn.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show("Security error. Please contact your administrator for details.\n\n" +
- "Error message: " + ex.Message + "\n\n" +
- "Details (send to Support):\n\n" + ex.StackTrace);
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment