473,397 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

CreateFile Problems

I'm trying to access a physical drive that is connected to the computer via CreateFile, b
Expand|Select|Wrap|Line Numbers
  1.         [DllImport("kernel32", SetLastError = true)]
  2.         static extern unsafe System.IntPtr CreateFile
  3.         ( string FileName, uint DesiredAccess,  uint ShareMode, uint SecurityAttributes, uint CreationDisposition, uint FlagsAndAttributes,   
  4.             IntPtr hTemplateFile         // handle to template file
  5.         );
  6.  
Jul 22 '08 #1
1 948
Curtis Rutland
3,256 Expert 2GB
Ok....you never said what the problem is.

Also, why do you want to create a file this way. FileInfo and FileStream are both good, built-in ways to create files.
Jul 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Chuck Rittersdorf | last post by:
Hi There I am having a problem using the win32 API from VB6. I am trying to send a command string to a printer(zebra TLP 2742) on LPT1 using the folowing API functions CreateFile and...
0
by: deepakjgupta | last post by:
Hello all, We are using SQL Server 2000 (Enterprise Edition) Merge Replication to synchronize databases between a main server database and about 200 local MSDE databases. Recently, we upgraded...
3
by: Antoine | last post by:
Hello, I'm writing a program to send requests to my wlan pocket pc device (UIO1: driver) in C#. Here how I import CreateFile functions from coredll.dll with DllImport: public static extern...
8
by: news.microsoft.com | last post by:
Hello, i'm having problems to call a api dll in vb dot net. I absolutely want to use this api call and none of the frame calls. This is my declaration: ***************** Public Structure...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.