473,419 Members | 1,715 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,419 software developers and data experts.

C# compact framework: IO problem: app running on PDA can't find file.

I've checked the file directory, and it's right. I was putting a ".txt" on the end, but someone told me that .txt is added automatically. They said that it would cause a redundancy. (i.e filename.txt.txt)

private void CheckForFile()
{
// Set directory path.
string directory = "\\My Documents\\UploadAmmoCards\\AC" +
MainOperations.AMU_SN;

// DirectoryInfo dirInfo = new DirectoryInfo(directory);

// If file does not exist
if (!File.Exists(directory))
{
MessageBox.Show(directory);
MessageBox.Show("ERROR: The file can not be found. " +
"The upload can not be processed.");
this.Close();
}

}

I have a second problem with the Close(). It gives me an ObjectDisposedException. If I handle that with a try/catch, It gives me an IO exception. Is there a reason that I can't close the form without finishing. I'm using it almost like a break.

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #1
1 2288
On Thu, 30 Dec 2004 23:41:12 GMT, Daniel Passwater via DotNetMonster.com
<fo***@DotNetMonster.com> wrote:
I've checked the file directory, and it's right. I was putting a ".txt"
on the end, but someone told me that .txt is added automatically. They
said that it would cause a redundancy. (i.e filename.txt.txt)

private void CheckForFile()
{
// Set directory path.
string directory = "\\My Documents\\UploadAmmoCards\\AC" +
MainOperations.AMU_SN;

// DirectoryInfo dirInfo = new DirectoryInfo(directory);

// If file does not exist
if (!File.Exists(directory))
{
MessageBox.Show(directory);
MessageBox.Show("ERROR: The file can not be found. " +
"The upload can not be processed.");
this.Close();
}

}

I have a second problem with the Close(). It gives me an
ObjectDisposedException. If I handle that with a try/catch, It gives me
an IO exception. Is there a reason that I can't close the form without
finishing. I'm using it almost like a break.


Would be better posted in the
microsoft.public.dotnet.framework.compactframework group...

AFA question 2, I would ask where are you doing this check? After/at form
load, or during form construction? But I'm purely speculating here and
will leave to the other group to answer...

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #2

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

Similar topics

2
by: paul | last post by:
I have developed an application for pocket pc that requires multiple forms to be open at any one time. The user is able to flick from one to the other, making changes to each as and when necessary...
3
by: Trevor Hughes | last post by:
Hello All I have a database (Access 2000, running on Win 2000), which suffers from bloat over a period of time. In order to solve the problem I set the option to compact on exit. This however...
2
by: Roland Rosier | last post by:
Hello, I am trying to use Managed C++ and the Compact .Net Framework on a Windows CE.Net 4.2 device. As far as I can tell, to use managed C++ you add the /CLR option to the C++ compiler and...
0
by: Harley | last post by:
I am trying to write a personal app to keep a bank balance and history. The problem I'm haveing is finding a decent way to store the data on a pocketpc under .net compact framewok useing vb.net....
5
by: bob | last post by:
Hi Using 2003 - targeting the compact framework (c#), but would like to do most development using the full.net (manually leaving out stuff not in the compact framework). Q. Trying to find a...
0
by: sameer | last post by:
hey! guys i have a barcode scanner Symbol MC 9060 running windows CE .net with compact 1.1 framework installed on it. My application is done in Visual studio 2003, winforms with vb.net 2003 and...
2
by: Greg Wood | last post by:
As a new member, I hope I am posting correctly. Bear with me if not ! I found a posting by Earle Oxner that very closely matches the situation we are in. Sadly, there were no replies to his post,...
2
by: Ron | last post by:
Hi All, Using WinXP pro/Access 2000. I have a database that's been used for about 5 months. Transferred lots of data from a dos based program, then the users have been using it for that 5...
24
by: luowan | last post by:
Hi I am currently building an application on .NetCF 3.5 in C#. The application needs to process xml files. I am thinking about using LINQ to process XML. I wrote a piece of code to modify the...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
1
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
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,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.