Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OpenFileDialog openFileDialog1 = new OpenFileDialog();
- openFileDialog1.Filter = "CSV files (.csv)|*.csv";
- openFileDialog1.FilterIndex = 1;
- if (openFileDialog1.ShowDialog() == DialogResult.OK) // Test result.
- {
- try
- {
- string file = openFileDialog1.FileName;//reads path to file
- NameValueCollection nvc = new NameValueCollection();
- HttpUploadFile("http://192.168.1.48:5001",
- file, "file", "file/csv", nvc);
- }
- catch (Exception ex)
- {
- MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment