प्रक्रिया। स्टार्ट को मौजूदा फ़ाइल नहीं मिल सकती है
- मेरे पास निष्पादन योग्य फ़ाइल (
C:\Test\n4.TestConsole.exe
) का पथ है। File.Exists(path)
true
देता है।File.OpenRead(path)
मुझे कोई समस्या नहीं होने पर इसकी स्ट्रीम मिलती है।Process.Start(path)
फेंकता इस संदेश के साथ एकSystem.ComponentModel.Win32Exception
:प्रणाली निर्दिष्ट फ़ाइल नहीं मिल रहा।
Windows 8 व्यावसायिक x64 - .नेट फ्रेमवर्क 4,5
संपादित करें: यहाँ कोड है।
public partial class Form1 : Form
{
public string Path { get; set; }
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
// I put a breakpoint here and verify the Path's value is
// C:\Test\n4.TestConsole.exe.
// File.Exists returns true.
MessageBox.Show(File.Exists(Path));
// File.OpenRead doesn't throw an exception.
using (var stream = File.OpenRead(Path)) { }
// This throws the exception.
Process.Start(Path);
}
}
फ़ाइल आप निष्पादित करने के लिए कोशिश कर रहे हैं के प्रकार क्या है? क्या यह 'निष्पादन योग्य' है? क्या आप पथ का मूल्य दिखा सकते हैं? –
@WouterdeKort: एक कंसोल एप्लिकेशन। यह खुलता है और जब मैं इसे डबल-क्लिक करता हूं तो इनपुट के लिए प्रतीक्षा करता है। पथ है: 'सी: \ टेस्ट \ n4.TestConsole.exe' –
पथ का मूल्य क्या है? यदि फ़ाइल System32 –