屏幕保护程序和命令行参数 [英] Screen Saver and commandline args

查看:94
本文介绍了屏幕保护程序和命令行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,

我编写了一个程序,可以很好地用作屏幕保护程序,并尝试将其转换为一个程序。 (不只是更改扩展名)



据我所知,您需要做的第一件事是在程序执行时拦截命令行参数。我写了这个并把它放在我的form_load事件中。


I have written a program that would work well as a screen saver and am attempting to convert it to one. (not just changing the extension)

As far as I understand the first thing you need to do is intercept the commandline arguments when the program executes. I wrote this and put it in my form_load event.

Dim ss As Array = Environment.GetCommandLineArgs
Dim s As Integer = ss.Length
If s > 1 Then
MsgBox("switch found " & s & vbNewLine & vbNewLine & ss(1).ToString)
If InStr(ss(1), "c") > 0 Then
End
End If
If InStr(ss(1), "p") > 0 Then
End
End If
If InStr(ss(1), "a") > 0 Then
End
End If
Else
MsgBox("No Switch " & s & vbNewLine & ss(0).ToString)
End If



如果我双击或右键单击/测试它会正常工作。(捕获并显示命令行)右键单击/配置不会发现命令行,进入屏幕保护程序面板并单击程序刚执行的按钮,好像这个代码不存在一样?!?



欢迎任何建议。


Which works fine if I double click or right click/test.(the commandline /s is captured and displayed) right click/configure produces no commandline found and going to the screen saver panel and clicking a button the program just executes as if this code is not there?!?

Any suggestions welcomed.

推荐答案

请参阅 http://support.microsoft.com/kb/818359 [ ^ ]。


这篇关于屏幕保护程序和命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆