Vb.net获取自定义Uri协议参数&解析

时间:2015-11-28 10:23:06

标签: vb.net-2010

我在这里搜索了很多关于stackoverflow和google搜索但是找不到任何可行的解决方案而且我是新手顺便说一下。 我有一个基于Windows窗体的应用程序。我可以通过设置注册码来自定义网址协议myapp://启动它:

My App > shell > command > pathtomyfile/app.exe

我添加了启动应用程序的超链接,即

myapp://test123

它启动app.exe就好了。现在我怎样才能将test123作为参数接收。

所以我的问题是:

如何在应用程序中收到test123作为参数?

1 个答案:

答案 0 :(得分:0)

试试这段代码:

- (void)viewDidLoad {
    [super viewDidLoad];
    textview.editable = YES;
    textview.attributedText = [[NSAttributedString alloc] initWithString:@"non-nil"]];
    textview.editable = NO;
    value = textview.attributedText;
    //^ value is @"non-nil" now !!!
}

您可以在Form1.Load或Form1.Shown事件中使用它。

相关问题