A
Arjen
Hi,
Here I have made some sample code.
I want to know if I'm using IDisposable on the right way.
public class Person {
public string name;
public string address;
}
public class main {
try {
Person person = new Person();
person.name = "Arjen";
}
catch{
throw;
}
finally{
((IDisposable)person).Dispose();
}
}
Is the IDisposable useful here?
(I want that the object don't exist any more in the memory)
Thanks!
Here I have made some sample code.
I want to know if I'm using IDisposable on the right way.
public class Person {
public string name;
public string address;
}
public class main {
try {
Person person = new Person();
person.name = "Arjen";
}
catch{
throw;
}
finally{
((IDisposable)person).Dispose();
}
}
Is the IDisposable useful here?
(I want that the object don't exist any more in the memory)
Thanks!