I want expose WebClient.DownloadDataInternal method like below:
[ComVisible(true)]
public class MyWebClient : WebClient
{
private MethodInfo _DownloadDataInternal;
public MyWebClient()
{
_DownloadDataInternal = typeof(WebClient).GetMethod("DownloadDataInternal", BindingFlags.NonPublic | BindingFlags.Instance);
}
public byte[] DownloadDataInternal(Uri address, out WebRequest request)
{
_DownloadDataInternal.Invoke(this, new object[] { address, out request });
}
}
WebClient.DownloadDataInternal has a out parameter, I don't know how to invoke it.
Help!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…