System.ObjectDisposedException: Cannot access a closed Stream when running this statement MemoryStream stream = (MemoryStream)data.GetData(cbExpression, false)
HARISH VN
1
Reputation point
public ResolvedExpression GetClipBoardExpression()
{
try
{
IDataObject data = Clipboard.GetDataObject();
if (!data.GetDataPresent(cbExpression, false))
return null;
using (MemoryStream stream = (MemoryStream)data.GetData(cbExpression, false)) `**>>>>>> Exception comes here , And this happens when copy and pasting text using ctrl+c and ctrl+v and only using RealVNC veiwer.**
{
BinaryReader reader = new BinaryReader(stream, System.Text.Encoding.UTF8);
}
Sign in to answer