Login
Register
Tutorials
Forum
Career Development
Resources
Reviews
Jobs
Interview
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
New Members FAQ
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Social
|
Talk to Webmaster
Tony John
Facebook
Google+
Twitter
LinkedIn
Online Members
Sriram
Phagu Mahato
More...
Join our online
Google+ community
for Bloggers, Content Writers and Webmasters
Forums
»
.NET
»
.NET
»
Attempted to read or write protected memory
Posted Date:
21 May 2012
Posted By::
Chinna
Member Level:
Bronze
Member Rank:
0
Points
: 5
Responses:
0
I am getting the the exception "Attempted to read or write protected memory.This is often an indication that other memory is corrupt" because of below code. Could you please help in the below code?
private void Configure()
{
try
{
string filePath = string.Empty;
FileStream fsRead;
BinaryReader binRead;
int rtnVal = 0;
filePath = GetBaseDirectory(@"\") + "Sample.BIN";
if (File.Exists(filePath) == false) return;
fsRead = new FileStream(@filePath, FileMode.Open);
binRead = new BinaryReader(fsRead);
if (binRead != null && binRead.BaseStream.Length > 0)
{
int MsI = -1;
binRead.BaseStream.Seek(0, SeekOrigin.Begin);
CRsiFkeyData pFkeyData = new CRsiFkeyData();
byte[] byteArray = binRead.ReadBytes(Convert.ToInt32(binRead.BaseStream.Length.ToString()));
while (++MsI < binRead.BaseStream.Length)
{
unsafe
{
pFkeyData.data[MsI] = byteArray[MsI];
}
}
rtnVal = objRsiHandReader.CmdPutFkeyData(pFkeyData);
binRead.Close();
}
fsRead.Close();
}
catch (Exception Ex)
{
Global.MakeEntry(Ex.Message + " Configure");
}
}
Tweet
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Post Reply
You must
Sign In
to post a response.
Tweet
Next :
How to get the data of datagrid view into rich textbox.
Previous :
How to download and instaal .net to learn c#.net and vb.net ?
Return to Discussion Forum
Post New Message
Category:
Related Messages
Is there any expert to solve this?
what is difference between String and string(data type) in c#?
what is a resource file...
Horizontal Scroll Bar for a listview control
sql querry
Follow us on Twitter:
https://twitter.com/dotnetspider
Active Members
Today
Sriram
(16)
naveensanagase...
(15)
musathik
(7)
Last 7 Days
baskar
(279)
Asheej T K
(203)
srisunny
(187)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds
About Us
Contact Us
Copyright
Privacy Policy
Terms Of Use
Revenue Sharing sites
Advertise
Talk to
Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.