Click here to Skip to main content
15,919,245 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Trying to open from outside....

Process.Start(@"C:\CSVreder.exe", (@"C:\31-122015.csv");



C#
***  my csv reader menu ***
       private void newToolStripMenuItem_Click(object sender, EventArgs e)
       {
           if (SaveIfModified())
               ClearFile();
       }

       private void openToolStripMenuItem_Click(object sender, EventArgs e)
       {
           if (SaveIfModified())
           {
               if (openFileDialog1.ShowDialog(this) == DialogResult.OK)
                   ReadFile(openFileDialog1.FileName);
           }
       }

       private void saveToolStripMenuItem_Click(object sender, EventArgs e)
       {
           if (FileName != null)
               WriteFile(FileName);
           else
               saveAsToolStripMenuItem_Click(sender, e);
       }

       private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
       {
           saveFileDialog1.FileName = FileName;
           if (saveFileDialog1.ShowDialog(this) == DialogResult.OK)
               WriteFile(saveFileDialog1.FileName);
       }
Posted
Updated 16-Jan-16 14:17pm
v2
Comments
PIEBALDconsult 16-Jan-16 20:18pm    
Dunno. I've never tried to open a file from the inside.
izak_il 17-Jan-16 1:07am    
Sorry about the poor wording of my question is my intention when Open File via the my csvreader app Through the Open File button' no problem' but when I try to open the file From another program by typing - Process.Start(@"C:\CSVreder.exe", (@"C:\31-122015.csv"); - Can notopen open the file with my csvreader.
*** My question is what to do with csvreader file To be able to open the file with a command from another file Process.Start(@"C:\CSVreder.exe", (@"C:\31-122015.csv");

1 solution

Read on how to use Main(string[] args) : Main() and Command-Line Arguments (C# Programming Guide)[^]
 
Share this answer
 
Comments
izak_il 21-Jan-16 2:20am    
Mehdi Gholam - Thank you i solved the problem the way you recommendation

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900