Click here to Skip to main content
15,891,597 members
Home / Discussions / C#
   

C#

 
GeneralRe: ReadFileEx OVERLAPPED LocalAlloc wows Pin
Guy Winslow8-Jun-04 11:17
Guy Winslow8-Jun-04 11:17 
GeneralRe: ReadFileEx OVERLAPPED LocalAlloc wows Pin
Heath Stewart8-Jun-04 11:26
protectorHeath Stewart8-Jun-04 11:26 
GeneralRe: ReadFileEx OVERLAPPED LocalAlloc wows Pin
Guy Winslow8-Jun-04 12:42
Guy Winslow8-Jun-04 12:42 
GeneralRe: ReadFileEx OVERLAPPED LocalAlloc wows Pin
Heath Stewart8-Jun-04 17:15
protectorHeath Stewart8-Jun-04 17:15 
Generalsql server ce 2.0, image data type Pin
khchan7-Jun-04 6:45
khchan7-Jun-04 6:45 
GeneralRe: sql server ce 2.0, image data type Pin
Heath Stewart7-Jun-04 6:51
protectorHeath Stewart7-Jun-04 6:51 
GeneralHardcoded filepaths c# Pin
frank217-Jun-04 6:34
frank217-Jun-04 6:34 
GeneralRe: Hardcoded filepaths c# Pin
Heath Stewart7-Jun-04 6:44
protectorHeath Stewart7-Jun-04 6:44 
NEVER hard code a file path. Put the filepath in the appSettings section at the bottom of the Web.config file and use ConfigurationSettings.AppSettings to get it (defaulting to a hard-coded path if you like). When you do it this way, do not escape back-slashes (that's specific to a programming language - not strings).

If you want to use a file from a share, then use "\\\\SERVER\\SHARE\\Dir1\\DB.mdb" or @"\\SERVER\SHARE\Dir1\DB.mdb" (notice the @, which is a literal character identifier).

Many of the IO members - unless you give them a URL - will assume a local path, which is why "C:" is being prepended to your string (well, the string isn't actually changed but the behavior is the same).

If this file is in your virtual directory structure of your web application, 1) make sure it's protected from user's downloading it but so that the web application can access it, and 2) use Server.MapPath or Page.MapPath to map the virtual path (like /db/db.mdb) to a physical path (like C:\Inetpub\wwwroot\db\db.mdb).

 

Microsoft MVP, Visual C#
My Articles
Generaldataset update on form closing Pin
C#Coder677-Jun-04 6:07
C#Coder677-Jun-04 6:07 
GeneralRe: dataset update on form closing Pin
Heath Stewart7-Jun-04 6:16
protectorHeath Stewart7-Jun-04 6:16 
GeneralVS2K3 doesn't copy file reference Pin
CBoland7-Jun-04 5:58
CBoland7-Jun-04 5:58 
GeneralRe: VS2K3 doesn't copy file reference Pin
Heath Stewart7-Jun-04 6:09
protectorHeath Stewart7-Jun-04 6:09 
GeneralRe: VS2K3 doesn't copy file reference Pin
CBoland7-Jun-04 8:45
CBoland7-Jun-04 8:45 
GeneralRe: VS2K3 doesn't copy file reference Pin
Heath Stewart7-Jun-04 8:47
protectorHeath Stewart7-Jun-04 8:47 
GeneralThreading and errors Pin
Russell Jones7-Jun-04 5:44
Russell Jones7-Jun-04 5:44 
GeneralRe: Threading and errors Pin
Heath Stewart7-Jun-04 6:20
protectorHeath Stewart7-Jun-04 6:20 
Generaldatasets, databinding and dataviews Pin
HappyPaws7-Jun-04 4:42
HappyPaws7-Jun-04 4:42 
GeneralRe: datasets, databinding and dataviews Pin
Heath Stewart7-Jun-04 5:21
protectorHeath Stewart7-Jun-04 5:21 
GeneralRe: datasets, databinding and dataviews Pin
HappyPaws7-Jun-04 7:43
HappyPaws7-Jun-04 7:43 
GeneralRe: datasets, databinding and dataviews Pin
Heath Stewart7-Jun-04 8:31
protectorHeath Stewart7-Jun-04 8:31 
GeneralRe: datasets, databinding and dataviews Pin
HappyPaws8-Jun-04 2:39
HappyPaws8-Jun-04 2:39 
GeneralRe: datasets, databinding and dataviews Pin
Heath Stewart8-Jun-04 3:13
protectorHeath Stewart8-Jun-04 3:13 
GeneralUpdate Stored Procedure throws Exception "Expects Parameter..." Pin
STW7-Jun-04 3:05
STW7-Jun-04 3:05 
GeneralRe: Update Stored Procedure throws Exception "Expects Parameter..." Pin
Heath Stewart7-Jun-04 3:42
protectorHeath Stewart7-Jun-04 3:42 
GeneralScrollable control with gradient background Pin
ongo7-Jun-04 3:03
ongo7-Jun-04 3:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.