开发者

VB.Net thread issue

开发者 https://www.devze.com 2023-02-15 11:41 出处:网络
I am trying to use a DLL that has a public class called FileCleanUp Inside this class is a procedure called ProcessFiles as shown

I am trying to use a DLL that has a public class called FileCleanUp

Inside this class is a procedure called ProcessFiles as shown

public void ProcessFiles(string fileName)
{
    this.ProcessFiles(fi开发者_如何学PythonleName, new ProgressChangedEventHandler(this.ProgressChangedHandler), new RunWorkerCompletedEventHandler(this.WorkCompleteHandler));
}

In VB.Net how do I access the ProcessFiles events so I can inform the user on progress etc from my VB.net application that calls this DLL.

By using Reflector have found that the DLL uses the Background Worker if this is of help.

If this is possible to do - please could you show me a code example \ brief solution.

Thanks for any help.


For your code snippet, ProcessFiles is looks like all you need to do is add a reference to this DLL, create a new instance of FileCleanUp and call ProcessFiles(string) you may have to pass in ProgressChangedHandler and 'WorkCompleteHandler' (class property or constructor) but it's evident from your snippet.

Dim fileCleanUp as New FileCleanUp()
...
...
fileCleanUp.ProcessFiles(someString)
0

精彩评论

暂无评论...
验证码 换一张
取 消