473,888 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Working the disk sectors directly from C#

Hi

Is there a way of working with sectors directly in C#. Any pointers, C# or
not, would be appreciated.

This is related to a previous post on file shredding in C#.

Thanks

Glenn

Jun 27 '08 #1
6 5237
On May 14, 11:29 am, "glennantho nyb" <glenn.csh...@y ahoo.co.ukwrote :
Is there a way of working with sectors directly in C#. Any pointers, C# or
not, would be appreciated.

This is related to a previous post on file shredding in C#.
My gut feeling is that you'd have to identify the native APIs you want
to use, then wrap them using P/Invoke.

Jon
Jun 27 '08 #2
On May 14, 6:29*am, "glennantho nyb" <glenn.csh...@y ahoo.co.ukwrote :
Hi

Is there a way of working with sectors directly in C#. *Any pointers, C#or
not, would be appreciated.

This is related to a previous post on file shredding in C#.

Thanks

Glenn
Hi,

NO.

You have to P/invoke . not only that but I don't know if there is any
API function that you can use for that.

You need to ask in unmanaged NG and apply the same from .NET
Jun 27 '08 #3
On May 14, 6:29*am, "glennantho nyb" <glenn.csh...@y ahoo.co.ukwrote :
Hi

Is there a way of working with sectors directly in C#. *Any pointers, C#or
not, would be appreciated.

This is related to a previous post on file shredding in C#.

Thanks

Glenn
of course, you can always call int 21 :)
Jun 27 '08 #4
you can open the disc in native/raw format just as if it was a normal file,
ofc this is risky if it has an atatched file system
its so long since I did it that ive forgoton the the filenames,
you have to use.

when I did it discs were <1gb i later tried my prgram on a 4gb drive and
realised I needed 64 bit version or drasticaly change it lol.
duno if this helps

ofc i dont know if your stil 'allowed' to do this especialy with vista.

there is also an internal sector relocation used by defraggers,
infact u can relocate 2 sectors from the dos cmd line if you realy wanted
to.

id love to move all the most used sectors and those used at boot time to
be in an optimal place, norton tools used to have this facility,
but they seemed to have droped that feature,
i havnt given them any buisiness since then.

Colin =^.^=

"glennantho nyb" <gl**********@y ahoo.co.ukwrote in message
news:eL******** ******@TK2MSFTN GP03.phx.gbl...
Hi

Is there a way of working with sectors directly in C#. Any pointers, C#
or not, would be appreciated.

This is related to a previous post on file shredding in C#.

Thanks

Glenn

Jun 27 '08 #5
On Wed, 14 May 2008 03:29:50 -0700, glennanthonyb
<gl**********@y ahoo.co.ukwrote :
Is there a way of working with sectors directly in C#. Any pointers, C#
or
not, would be appreciated.
P/invoke is technically "from C#" when used in C#, so sure...you should be
able to do it. :)

That said, I'll reiterate part of my comment from the previous thread: are
you sure you need to do this? Your description of the level of "file
shredding" you want didn't suggest any need to access the disk sectors
directly.

Pete
Jun 27 '08 #6
If it was going to be simple, I'd give it a try, as it doesn't appear to be
straightforward , I'll stick with the original, much simpler, method.

Thanks for the advice

Glenn

"Peter Duniho" <Np*********@nn owslpianmk.comw rote in message
news:op******** *******@petes-computer.local. ..
On Wed, 14 May 2008 03:29:50 -0700, glennanthonyb
<gl**********@y ahoo.co.ukwrote :
>Is there a way of working with sectors directly in C#. Any pointers, C#
or
not, would be appreciated.

P/invoke is technically "from C#" when used in C#, so sure...you should be
able to do it. :)

That said, I'll reiterate part of my comment from the previous thread: are
you sure you need to do this? Your description of the level of "file
shredding" you want didn't suggest any need to access the disk sectors
directly.

Pete

Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1557
by: Bruce | last post by:
I have a table with some sensitive customer data in it. I am now keeping all the data in another table, and encrypting it. I want to get rid of the original unencrypted data and be sure that it is no longer anywhere on disk. Should I drop the table, or first delete the rows and then do a dump tran? I'm not sure how to know if the data is actually physically deleted from disk, or if it's still there, but just in blocks that get marked...
1
2567
by: Jason | last post by:
In SQL 2000, is there an advantage to defining and using a backup device versus just backing up to disk? Currently, I've got a SQL Backup job set to run once per day, with transaction log backups running every hour. The db and backups are written directly to folders on an external disk array. I've never configured an actual Backup Device within SQL. Does creating a Backup Device offer any advantages not available with my current backup...
3
2396
by: King W.Wang | last post by:
Hi all, I've deleted 2 folders and emptied the trash bin on a hard disk in Windows XP. And then I found that I've no back-up of these folders. I want to rescue the data in these folders. The hard disk with NTFS is connected to the PC through USB. Since the deletion I've made no writing on this disk. I can imagine that the data can be rescued, at least a part of them. A program which does the similar job as CHKDSK in DOS should help me:...
1
6297
by: Shrirang Ballal | last post by:
I am doing a project which requires to read the raw bytes from hard disk. It rrequires to access the partition table and then the individual partitions. I want some material related to these issues. If someone can suggest of a book then that is also good. All the books I have seen are related to the GUI design. Waiting for reply, Thank you
2
5097
by: kg | last post by:
how to read the disk block in linux using c .. and also i want to display the information like number of sectors in the disk ..number of free sector .. totaly i want to display the partion informaation
1
11082
by: d.albano | last post by:
Hi to all, this is my first post in this group. I need to directly access to a disk but i'm getting some problem to let to filestream to work. I use createfile to acquire PhysicalDrive0 handle and after i pass the pointer to filestream constructor to manage it using .NET related methods
1
13842
by: PIERRE BECKER | last post by:
Hi, Does anyone know which classes I shall use to read physical sectors of a floppy (A:) , cd or dvd disc ? I need this to try and read disk with non-dos/pc structure. Thanks in advance for any help. Sincerely, P.B. (pibecker@modulonet.fr)
13
4889
by: ragtag99 | last post by:
I posted this on comp.lang.asm.x86, alt.os.development, comp.arch, comp.lang.c++ Im working with windows xp professional, NTFS and programming with MASM, c++ (free compiler) or visual basic 6.0 === question 1 Primarily Im trying to design a program that has full control over a hard disk. What it needs to do is find out what sectors haven't been
6
30718
by: Paul Bromley | last post by:
Ok - I have given up on trying to find the active IP address for a given PC. For licensing purposes I need to retrive a unique identifier from the PC that the program is installed on. The Hard disk serial number would do fine, but on Googling it seems that some of the sample code will now laways work on W2K, and not without administrator rights. Hence my question - how can I consistently get a UNIQUE PC identifier using vb.net 2003 - not...
0
9957
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10772
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9593
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7988
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4635
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4239
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.