I'm trying to grab my files from isolated storage but unfortunatly it is pulling in all the files not just the specified ones from the pattern.
I'm using:
foreach (string fileName in storage.GetFileNames("*.item"))
Is this a known bug or am I just doing something wrong?
PS. The use of wildcards is essential
Any help very much apprieciated,
Thanks!
I'm not sure why it is not working. But you can try this one as well:
storage.GetFileNames().Select(fileName => fileName.EndsWith("item"));
There is a IsolatedStorage search pattern bug in the final SDK release. Have a look at this post - http://blogs.compactframework.de/Peter.Nowak/2010/09/18/WP7+Final+SDK+Bug+IsolatedStorageFile+And+Ldquosearchpatternrdquo+And+A+Fix.aspx
HTH, indyfromoz
This is a known issue. You'll need to either structure your files into folders if you want to limit what's retrieved or test/filter the filenames before loading them.
Looks like a bug in the CTP/Beta versions of IsolatedStorageFile.GetFileNames(string pattern)...
http://blogs.compactframework.de/Peter.Nowak/Trackback.aspx?guid=4d8d9b73-619f-43c7-bf6c-12429327206b
This API bug has been fixed in the release of the Windows Phone 7.1 SDK (Otherwise known as the "Mango" release).
Your code will work fine now.
Related
I'm trying to use Iron OCR's library for OCR, I came across this error while trying to do the basics.
AutoOcr OCR = new AutoOcr() { ReadBarCodes = false };
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
var Results = OCR.Read(#"Screenshot.png");
Console.WriteLine(Results.Text);
OCR Exception:Iron OCR InstallationPath Permission Error 1772. Could not deploy and run IronOCR resources to path '' for user 'MYPCNAME\MYUSER'. This can be fixed globally by setting IronOcrInstallation.InstallationPath to a directory on disk with file read and write permissions. Please refer to documentation at http://ironsoftware.com/csharp/ocr/docs/html/P_IronOcr_IronOcrInstallation_InstallationPath.htm
This is the full error I get every time I try to run this code. If anyone could give me a hand, I'd appreciate it. Thanks!
That permission message is pretty misleading and wrong for most of the cases, I solved it by installing the c++ runtime (32+64) and it works like a charm!
In my case it was due to using .net core. IronOcr does not support it, use .net framework instead. Unfortunately they didn't bother to document this clearly.
Thanks staind852 for the suggestion on github
I would like to get a list of the files which have been opened by the user a) recently and/or
b) frequently.
Is this information available on Windows operating systems (Need support for everything down to XP) and if yes, is there a way to use this data with .NET Framework?
Searching the topic on Google is kind of hard, because the results are always referring to solutions where people want to achieve the same thing for their own application only (i.e. create a list of recently used files). I need the same thing on OS level, not just for files which have been opened with the appplication created by me.
An easy solution can be to use Environment.SpecialFolder.Recent:
string path = Environment.GetFolderPath(
Environment.SpecialFolder.Recent);
var files = Directory.EnumerateFiles(path);
Note that this solution only lists the recent opened documents. If you want a better solution, you can take a look to this article about how to use the Windows.Storage.AccessCache API:
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh972344.aspx
If you are looking for Windows' MRU List you can find it in Registry.
This link might help you alot.
I want to monitor the changes made by my installer, and I found the processmonitor is useful, But it just get too many information, and really hard to retrieve what I need. Is there any better solution on monitoring ? Like what folder, file, registry the application created ?
Thanks !
I often used InCtrl 5 (it's old but usefull).
did you try filtering un-necessary information?
Filters in processmon are very good and correctly prints only what you need.
If you are looking for professional application, there was one I used to use: Norton Cleansweep.
http://en.wikipedia.org/wiki/Norton_CleanSweep
Its no longer developed by Norton, but should not be hard to find if you want to grab one copy.
Hello I recently deleted what I thought was an unused folder which happened to have the solution and code for a windows application I am maintaining.
I have published the app multiple times with ClickOnce and have access to the application manifest, deploy, etc. Is there a way for me to use the published application to get back my solution?
Thanks
If you don't currently use source control, I would highly recommend using one. I'm not aware of a way to get back all the solution files without source control, but you can get back the code using .NET Reflector. There is a file disassembler add-in which allows you to dump the code straight out of Reflector.
not possible. you can't recover the solution and original code from the compiled and deployed version.
if you have not used that machine or hard drive since you deleted it, you may be able to recover the files but it's a long shot and may be expensive.
you need to invest some time in learning source control. git, mercurial, subversion... they're all free and easy to use in windows. having your code in source control would prevent this problem - delete it all you want, just do a checkout from source control again.
Just go get the project back from Subversion.
Basically all you can do at this point is feed the assemblies to a program like reflector and reverse engineer it back. Welcome to sucksville.
If you don't have your stuff in some type of repository already I'd highly recommend fixing that first thing in the morning. With free tools like subversion available, nevermind things like TFS or even VSS there just isnt a good excuse.
I'm using MSVE, and I have my own tiles I'm displaying in layers on top. Problem is, there's a ton of them, and they're on a network server. In certain directories, there are something on the order of 30,000+ files. Initially I called Directory.GetFiles, but once I started testing in a pseudo-real environment, it timed out.
What's the best way to programatically list, and iterate through, this many files?
Edit: My coworker suggested using the MS indexing service. Has anyone tried this approach, and (how) has it worked?
I've worked on a SAN system in the past with telephony audio recordings which had issues with numbers of files in a single folder - that system became unusable somewhere near 5,000 (on Windows 2000 Advanced Server with an application in C#.Net 1.1)- the only sensible solution that we came up with was to change the folder structure so that there were a more reasonable number of files. Interestingly Explorer would also time out!
The convention we came up with was a structure that broke the structure up in years, months and days - but that will depend upon your system and whether you can control the directory structure...
Definitely split them up. That said, stay as far away from the Indexing Service as you can.
None. .NET relies on underlying Windows API calls that really, really hate that amount of files themselves.
As Ronnie says: split them up.
You could use DOS?
DIR /s/b > Files.txt
You could also look at either indexing the files yourself, or getting a third part app like google desktop or copernic to do it and then interface with their index. I know copernic has an API that you can use to search for any file in their index and it also supports mapping network drives.