دوست عزیز جواب شما اینجاست
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
unsafe static void ReadMemory()
{
TextWriter fs = new StreamWriter("MemoryDump.txt");
int* ptr;
for (int i = 0; i < 100000; i++)
{
ptr = (int*)i;
try
{
Console.Write(*ptr);
fs.Write(*ptr);
fs.Write(" ");
Console.Write(" ");
}
catch
{
fs.Write(" * ");
Console.Write(" * ");
}
}
fs.WriteLine("** FINISH **");
}
static void Main(string[] args)
{
ReadMemory();
Console.WriteLine("** FINISH **");
Console.ReadLine();
}
}
}