0
我嘗試使用此代碼打開電子郵件客戶端(Outlook或Gmail,具體取決於用戶的偏好)。指向電子郵件地址的超鏈接
XAML:
<TextBlock Margin="0,5,0,0" >
<Hyperlink RequestNavigate="HandleRequestNavigate" Foreground="{StaticResource EnableColorSolid}" NavigateUri="http://[email protected]">
[email protected]
</Hyperlink>
</TextBlock>
代碼:
private void HandleRequestNavigate(object sender, RequestNavigateEventArgs e)
{
string navigateUri = (sender as Hyperlink).NavigateUri.ToString();
// if the URI somehow came from an untrusted source, make sure to
// validate it before calling Process.Start(), e.g. check to see
// the scheme is HTTP, etc.
Process.Start(new ProcessStartInfo(navigateUri));
e.Handled = true;
}
但它不工作。任何想法爲什麼?我認爲這個鏈接有問題,但我不知道它是什麼。
使用 「電子郵件地址」 的不是 「http://」 – Vishal