掉落和玩耍的问题 [英] drop and play problem
本文介绍了掉落和玩耍的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨.
当我将歌曲放到媒体中时,我要在媒体播放器中工作.自动播放.
而另一个问题是,当我用媒体播放器打开一首歌时,我显示一个消息框
"Illegal characters in path. mscorlib"
这意味着什么,我该如何解决这两个问题.
谢谢.
hi.
I am working in media player I want when I drop a song into my media play it Automatically .
and another problem is when I open with a song with my media player I show a message box
"Illegal characters in path. mscorlib"
what this mean and how can I solve those 2 problems.
Thank.
推荐答案
如果不看代码,很难甚至不可能诊断出第二个问题:请提供相关的代码片段!
对于拖放:
1)将表单的AllowDrop属性设置为True
2)为表单的DragEnter和DragDrop事件创建一个处理程序.
3)在DragEnter处理程序中,添加以下代码行:
Without seeing the code, it is difficult if not impossible to diagnose the second problem: please provide a relevant code fragment!
For drag and drop:
1) Set the AllowDrop property of your form to True
2) Create a handler for both the DragEnter and DragDrop events of your form.
3) In the DragEnter handler, add the following line of code:
e.Effect = DragDropEffects.Move;
4)在DragDrop处理程序中,添加以下内容:
4) In the DragDrop handler, add the following:
string[] files = (string[]) e.Data.GetData(DataFormats.FileDrop);
if (files != null)
{
foreach (string file in files)
{
Console.WriteLine(file); // Or whatever you need to do...
}
}
或者,如果您需要在VB中输入...:O
Or, if you need in in VB...:O
Dim files As String() = DirectCast(e.Data.GetData(DataFormats.FileDrop), String())
If files IsNot Nothing Then
For Each file As String In files
Console.WriteLine(file) '' Or whatever you need to do...
Next
End If
这篇关于掉落和玩耍的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文