从按钮打开日历应用程序? [英] Open calendar app from button?

查看:82
本文介绍了从按钮打开日历应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨....



如何从VB中的按钮打开win 10日历应用程序?!



谢谢!



我尝试过:



i搜索谷歌,但它只返回在VB中制作新日历的选项!!!

hi....

how do i open the win 10 calendar app from a button in VB?!

Thank you!

What I have tried:

i searched google but it only returns options to make a new calendar in VB!!!

推荐答案

这引起了我的兴趣,所以我试了一下,但是失败了。 Win10应用程序不像普通应用程序那样运行。



所以我做了一些谷歌搜索(从命令行运行10日历 - Google搜索 [ ^ ])并发现:应用程序命令列表Windows 10 Windows 10应用程序&功能教程 [ ^ ]



现在我有一个可行的解决方案:

This peeked my interest, so I gave it a try and failed. Win10 apps don't run like normal apps.

So I did a little Googling (run win 10 calendar from command line - Google Search[^] ) and found this: App Commands List for Windows 10 Windows 10 Apps & Features Tutorials[^]

Now I have a working solution:
Module Module1

    Sub Main()

        RunProcess("", "outlookcal:", "", waitForExit:=False)

    End Sub

    Private Function RunProcess(workDir As String, appName As String, args As String, Optional hide As Boolean = False, Optional waitForExit As Boolean = True) As Integer

        Dim proc = New Process()

        With proc
            .StartInfo.WorkingDirectory = workDir
            .StartInfo.FileName = appName
            .StartInfo.Arguments = args

            .StartInfo.CreateNoWindow = hide

            .Start()

            If waitForExit Then
                .WaitForExit()
                Return proc.ExitCode
            End If
        End With

        Return 0

    End Function

End Module



以下是一些更有趣的命令:

* 如何创建Windows快捷方式Windows 10更新 [ ^ ]

* 如何使用Shell命令打开Windows 10应用程序来自SuperSite for Windows的Windows Server内容 [ ^ ]


您需要为Outlook应用程序执行URI,VB或C#无关紧要。我刚才写了一个答案,如何打开单击我的ASP.NET Web应用程序按钮时,用户的Windows Outlook日历。 [ ^ ]。



您可以考虑使用以下对象来启动URI,

Windows.System.Launcher.LaunchUriAsync(Uri ),然后传递Uri for Outlook日历。整个过程是类似的,唯一的区别在于我需要通过JavaScript做的其他答案,在这里你将通过框架对象完成。有关此对象的更多信息,请参阅: [ ^ ]
You need to execute the URI for Outlook application, VB or C# doesn't matter. I wrote an answer a while ago, How to just open user's windows outlook calendar on a button click of my ASP.NET web application.[^].

You can consider the following object to launch a URI,
Windows.System.Launcher.LaunchUriAsync(Uri), and then pass the Uri for Outlook calendar. Overall process is similar, the only difference was on my other answer you needed to do that through JavaScript, here you will do through framework objects. For more on this object, please see: [^]


这篇关于从按钮打开日历应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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