我想播放像那个人那样的视频[链接].
我正在使用C#Windows表单应用程序(不是NXA).但我不知道怎么做.我尝试过Microsoft.DirectX.AudioVideoPlayback但没有运气.
这是我到目前为止所尝试的:
OpenFileDialog rihanna = new OpenFileDialog();
if(rihanna.ShowDialog() == DialogResult.OK)
{
video = new Video(rihanna.FileName);
video.Owner = panel1;
video.Stop();
}
Run Code Online (Sandbox Code Playgroud)
现在我该怎么办?我尝试使用视频课,但正如我所说它只是没有用.我能够编译但是当我运行程序时,我没有看到窗体窗口.
我想在小数点后创建pi超过16000个数字,但是problam是我找不到任何可以满足我意愿的类型.我尝试使用对象,但它在10之后将数字舍入我想使用字符串但字符串类型不能做减号或加号如果我将转换为int它将变成圆形.你知道我可以使用的任何其他类型或如何使用字符串工作,例如 http://files.extremeoverclocking.com/file.php?f=36这个程序能够计算多达3200万
日Thnx
我知道字符串就像一个类,当创建一个新字符串时,字符串本身并不欠值,而只是值的指针.但是在创建字符串时,不需要使用new;
string a = "hello";
Run Code Online (Sandbox Code Playgroud)
并不是
string a = new string("hello");
Run Code Online (Sandbox Code Playgroud)
我知道第二个选项也是可能的,但我想了解的是为什么第一个?
假设我有一个类名学生,他的构造函数得到了string.要创建一个新类,我必须使用保存的单词new.
student example = new student("Sabrina");
Run Code Online (Sandbox Code Playgroud)
我尝试过载,oparator =但这是不可能的.
如何创建一个像string(不使用单词new)的新类?
student example = "Sabrina";
Run Code Online (Sandbox Code Playgroud) 我明白使用正则表达式时我可以输入值|来搜索许多值.例如:
Regex sabrina = new Regex("Rihanna|rihanna|Sabrina|sabrina");
Run Code Online (Sandbox Code Playgroud)
我有一个字符串,我想与其他值进行比较,所以我这样使用if:
if (rihanna == "Rihanna" || rihanna == "sabrina")
Run Code Online (Sandbox Code Playgroud)
我的问题是,是否有可能if缩短?我知道这段代码不起作用,但我正在寻找这样的东西:
if (rihanna == "Rihanna|sabrina")
Run Code Online (Sandbox Code Playgroud) 我拥有MediaElement,并且我想播放视频,因为我知道这样做的唯一方法是设置此项Source
mediaElement1.Source = new Uri(fileName);
Run Code Online (Sandbox Code Playgroud)
但是现在我有了要播放的资源文件,但我不能这样做,因为它没有路径。为了简而言之,我正在寻找一种方法来从资源文件中播放madiaElement中的视频(不首先写入其字节)。
我做了一个小程序,应该显示小MessageBox.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WpfBrowserApplication1
{
/// <summary>
/// Interaction logic for Page1.xaml
/// </summary>
public partial class Page1 : Page
{
public Page1()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("gs");
}
}
}
Run Code Online (Sandbox Code Playgroud)
结果:

为什么?我如何通过一个简单的按钮获得一个小网页,当你点击他显示messgebox?