|
Hi,
yes the try-catch is the preferred way since it occurs rather infrequently anyway.
do you really need the availability of the entire list of files before you start
doing something with it? can't you do whatever it is you want to do on the fly,
in the recursive routine, without building the entire list?
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Baically the reason I went for that is I'm building a database of certain files that users of my app are interested in.
There are other routines in the app to categorise these files. One screen of my app provides a treeview for them to browse around the machine which builds file lists as it goes. The other main feature allows them to build a database (a serializable observable collection) and I want to be able to provide some kind of visual feedback on its progress via a progress bar.
Basically I couldn't think of any way to accurately provide this feedback without basing it on some 'known quantity' beforehand. So I decided to build the list of directories to scan ahead of further analysis then the the progress bar can be based on the apps knowledge of the directory structure to be scanned by the app.
Jammer
Going where everyone here has gone before!
|
|
|
|
|
Hi,
yes progress information can be very useful, and it eases the user's mind.
Oftentimes Windows will cheat to save either a lot of code, or CPU cycles.
One way to cheat is show progress bars that go forward and backward, or have
two levels and varying speeds; another is showing busy status, busy being really
working at it, or just "not done yet".
One trick about files in a partition is using file sizes rather than file count;
you can get the total space used on a (local disk) partitition quite easily, and
accumulute file sizes while you process the files.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi Luc,
That's actually a really interesting idea about the file sizes ... I'm going to give that some thought.
I wonder if there are any patterns out there that address this sort of problem?
Regards,
Jammer
Going where everyone here has gone before!
|
|
|
|
|
I am not aware of any pattern that solves the progress issues, but then I am
not a pattern specialist, I'm a pragmatic kind of guy, who sometimes happens
to apply a pattern without knowing all the theory.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
haha! good work! I respect that!
Jammer
Going where everyone here has gone before!
|
|
|
|
|
Hi All,
I am trying to design an approach on communicating with a c# application on a remote system through IE/Firefox type of web interface in a closed network(it will mostly involve in sending commands the the c# app) . I have done a lot reading on the web and searched the forum, however I haven't found any definite direction on how to approach the problem, the closest solution that I found is this article http://www.codeproject.com/KB/IP/remotinggui.aspx[^]. Since the app is written in c# I'd imagine there are some sort of API build for it to be able to reference the objects through web interface. Are there any ideas on how to approach this in a simple and direct manner?
|
|
|
|
|
If you want to use communication mechanisms, and you have a system running VS2005 or VS2008, you should really look at Windows Communication Foundation (WCF). It's designed for creating communication quickly and easily.
|
|
|
|
|
How about if I am using VS2003? thanks.
|
|
|
|
|
Then you're stuck with remoting or web methods. Good luck.
|
|
|
|
|
Is there a way to clean the recently used projects list. If so, please explain. It kind of irritates me to have hem on there, as in when I try a downloaded sample, they never work and end up on the list. I know you can just wait it out, but I want the list clean, so help would be appreciated. Thanks.
- I love D-flat!
- Need. More. Code.
|
|
|
|
|
They're stored in the registry - HKCU\Software\Microsoft\VisualStudio\9.0\ProjectMRUList for 2008 if I remember correctly
Dave
|
|
|
|
|
Thanks! Will this work for 05'? (Visual C# 2005 Express)
Also, where do I enter this path in? My documents seems epty for this...
- I love D-flat!
- Need. More. Code.
|
|
|
|
|
You need to run regedit
something like
HKEY_CURRENT_USER\Software\Microsoft\VCSExpress\8.0\ProjectMRUList
Dave
|
|
|
|
|
you can also move all the projects into a different folder and then try opening them. You'll then be given the option of removing them from the list.
Dave
|
|
|
|
|
This project isn't in the "Projects" folder. And I can't open (not that I want to) the one I can;t get rid of. How long does a project usually stay in the list?
- I love D-flat!
- Need. More. Code.
|
|
|
|
|
indefinately AFAIK. Hover your mouse over the entry and it'll tell you it's location in the status bar. Simply move the project from that location (or delete it) and then try and open it from the list. It should tell you it can't be found and ask you if you'd like to remove it from the list.
Or as I suggested earlier, run regedit and delete the entry for that project.
Dave
|
|
|
|
|
Can you explain regedit? (I'm sorry, I'm still a beginner... Haven't done too much for a long time for real, anyway... And I've never really messed around with internal C# stuff)
Where can it be found?
- I love D-flat!
- Need. More. Code.
|
|
|
|
|
I just erased everything under it's file, and I try to open it and it STILL lets me open it, but it's unavailable. How do I get rid of it? Step by step instructions, please? THanks for your help, though.
- I love D-flat!
- Need. More. Code.
|
|
|
|
|
Well; I just got it. I messed the name up, and it let me remove. Thanks for the help, even though it's STILL over my head.
- I love D-flat!
- Need. More. Code.
|
|
|
|
|
I see you sorted it. For future reference - or anyone else that comes across this:
1. Close Visual Studio
2. Start, Run... type in regedit and hit OK
3. Open the folders/sub folders in the treeview in reg edit in this order
HKEY_CURRENT_USER
Software
Microsoft
VCSExpress (// VBExpress for VB, VisualStudio for Full VS)
8.0 (// for 2005, 7.0 for 2003, 9.0 for 2008)
ProjectMRUList
4. Make sure that ProjectMRUList is selected so the status bar reads in your case:
My Computer\HKEY_CURRENT_USER\Software\Microsoft\VCSExpress\8.0\ProjectMRUList
On the right will be a list of string values named File1, File2 etc with values that match the location of your Most Recently Used (MRU) projects e.g.
%USERPROFILE%\My Documents\Visual Studio 2005\Projects\Windows Application 1.sln
5. Right click on the value name and select Delete
6. Rename any higher named values so they are sequential File1, File2 etc... if there is one missing in the sequence VS will stop looking beyond the lowest one found.
7. Close regedit and relaunch Visual Studio and the project will no longer be in your list
Dave
|
|
|
|
|
Hi everybody,
I have a small Windows C# distributable application that connects to SQL Compact 2005. The application allows the user to view,insert,update and delete records stored in the database. This is a single user application and I would like to extend it to be a multiuser application. I want the application to be installed on a main machine (which would connect to the database) and have client installations which would perform the operation on the database installed in the main machine.
I am new to this subject and I am not sure where to start. I have been looking for a book or samples that would help me achieve this but I haven't been able to find anything. I have been looking for "2-tier applications c#", "client server applications .net", etc.
Could somebody guide me in the right direction?
Thanks in advance!
|
|
|
|
|
|
|
Hi,
in client server application, we have to use common Connection String, so that all the client installation can connect with centralized database at Server.
so, have you used connection string in your single user application ? if yes then use the connection string of Central server in App.config file so all client installation will point central server database.
use the connection string in App.config like,
<connectionstrings>
<add name="Connection String" connectionstring="Data <br mode=" hold=" /">Source=local/(central Server instance name);Initial Catalog=Database Name;User ID=sa;Password=sa" providerName="System.Data.SqlClient" />
then use this connection string in your Connection object.
so your all database related code will point this central server.
try this.
Chirag Patel
Programmer Analyst
|
|
|
|