I am using windows 7 and I have a problem that after sometimes that windows is running some of my pdf's, office and txt files are being corrupted.... the files are sometimes corrupted and sometimes not..
Hello and welcome to the forum.
Perform a chkdsk on the Drive where the files are being stored.
chkdsk C: /R
answer "Y" = yes when prompted
reboot the computer and wait for all five stages to complete
check the results in event viewer.
You may also want to perform a memory diagnostic
Download Memtest86+ from this location here. Burn the ISO to a CD and boot the computer from the CD from a cold boot after leaving it off for an hour or more.
Ideally let it run for at least 7 passes / 6-8 hours. If errors appear before that you can stop that particular test. Any time Memtest86+ reports errors, it can be either bad RAM or a bad Mobo slot. Perform the test RAM sticks individually as well as all possible combinations. When you find a good one then test it in all slots. Post back with the results.
See this Guide to using Memtest 86+
Those are the two most likely culprits for file corruption, although I would expect more broader problems, even with your OS files if it is hosted on the same drive as the files where you are experiencing the corruption.
I only posted 30 minutes ago.
I would think that it might have taken longer than 30 minutes to perform a complete check disc of the drive hosting those files, not to mention hours it should take to run MemTest86+ properly to assess the condition of your RAM.