单一MDI应用 [英] Single MDI Application
问题描述
你好,
我正在使用单实例
http://www.codeproject.com/KB/cs/CSSIApp.aspx [ ^ ]
我想要的是当我们通过打开方式"打开.txt文件时,我希望我的应用程序每次打开.txt时都为我提供.txt的路径.
示例:
1.用户打开.txt文件,通过打开方式"应用程序将.txt文件路径发送到form2
2.在该form2之后,读取.txt文件路径(取自form1)
错误:
如果我有C:\ 01.txt和C:\ 02.txt当我们打开第一个文件时,我们会发现路径正确,但是当我们打开第二个文件时,我们会发现路径不正确,因为第一个文件是路径
我的代码:
Hello,
I''m using Single-Instance
http://www.codeproject.com/KB/cs/CSSIApp.aspx[^]
what i want is when we open .txt file by "Open With" i want my application to give me the path of the .txt in each time we open .txt
Example:
1. The user open .txt file , by "Open With" the application send the .txt file path to form2
2. After that form2 read the .txt file path (taken from form1)
Error:
if i have C:\01.txt and C:\02.txt When we open the first file we will find that the path is correct , but when we open the second file we will find the path is incorrect becouse is the first file path
My Code:
string[] args = Environment.GetCommandLineArgs();
foreach(string arg in args)
{
MessageBox.Show(arg);
}
[edit DMA:已修复链接]
[edit DMA: Link fixed]
推荐答案
使用新的词义词解决问题
use new kekword to solve the problem
这篇关于单一MDI应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!