Read and Write to memory using c#