Windows 8 APP : Store data [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
What is the best way to store data for a Windows 8 APP ?
I need to store from one to thousands of little pictures (max 300x300px) (Load from FilePicker).
Also, is there a recommended practice to store picture (A class rather than an other) ?w

Storing 1000 of images uncompressed in memory could hang computer, depending on images and memory available. So that's not the best practice.
You haven't mentioned why you need to do this, so there is no clear solution, but some guidelines:
if you need to show many pics on screen, use XAML (e.g. Image element) and set path to the image on web or local disk. Windows will do the caching for you. Also, put Image element in GridView or ListView and use Data binding
if you afraid that images might get lost and it is not enough to keep just path, copy them in ApplicationData LocalFolder.
if you need to do some operations on images, then load into memory the one you need or load them one by one.

Related

Is it okay to save thumbnail version in file system? what is the common practice? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have a web application I'm building up, where in one of the module, I let the users to upload images which are later shown in a slider with thumbnails on the bottom.
My question is, should I save the thumbnail version in the file system or is it better to create an API that accepts the path to the image and returns a resized version with desired content type?
Saving the thumbnail gives an additional overhead of maintaining additional files. But if I create a WebAPI to resize the image on demand, I'm worried, if it will affect the performance as it involves image processing.
How would you handle this situation?
I think it's pretty common practice to resize images to all the different thumbnail sizes you will need and save them to some data store. It will probably make very little difference in terms of how much total storage you will need (since you're storing the biggest picture either way) and the performance gain is well worth it.
At my company, we save about 20 different thumbnail sizes for each photo and save them all to Amazon S3 where storage is dirt cheap and they have a fast content delivery network to make page loads lightning fast.
Use ImageResizer, an HttpModule that could resize on-the-fly and cache your thumbnails without an extra code. You need to download it to the \bin, setup a web.config and you will be able to resize images using e.g. URL API as
<img src="large.jpg?width=100" />
Since you are concerned about performance, setup a DiskCache feature and let to cache resized images to disk.

Limit user on file downloads and file redistribution (discussion) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I would like to implement a file download control for my asp.net c# MVC 4 web application. The requirements are as such
1) Only Logged in user can download the file (pdf etc.)
2) Each User can only download the file once
3) downloaded file should not be able to redistribute to others (this is what puzzled me the most)
For 1) and 2), I think these can be achieved by having records storing access information in database table.
However, I can't think of ways to achieve part 3) unless there is a way to limit the file content to query from server whenever it is opened.
Please share your idea and learn together. Cheers and thanks ~~
As you said 1 and 2 is trivial since you can track it on the server.
Number 3 will be for you probably impossible to solve. Amazon, Apple and other big companies which need to protect copy rights of eBooks or MP3, they offer to download, handle this with Digital Right Management Systems (DRM). However setting up such a system yourself, while possible, will be for sure not worth the effort.

how long do things in the windows 8 future access list last [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
if I add an item to the future access list in a windows store app, will it stay accessible the next time the app is run? after the machine has been turned off?
or does it only last as long as the app is running
The future access list is persistent across app sessions, reboots, app upgrades, etc. That's its whole purpose.
To expand on the idea a little, because StorageFolder and StorageFile are abstractions for pathnames--and accommodate folders and files on storage systems that cannot be represented by pathnames--you use the access cache instead of saving pathname strings in your app data. For this reason, consider the access cache a specialized method of app data storage, specifically for saving file references + permissions.

Quick file loading in C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a requirement to load a file containing up to 1 million lines of string data. My first thought is to use C# 5.0 async to load the data whilst not blocking the UI thread. If the user tries to access something that relies on the data they will get a loading message.
Still I would like the fastest possible method in order to improve the user's experience.
Is the speed of reading data from the disk purely a function of the disk speed and thus StreamReader.ReadAllLines() is as performant as other c# code? Or is there something 'fancy' I can do to boost performance programmatically. This does not have to be described in detail. If so what approximate percentage improvement might be achieved?
I am purely interested in read speed and not concerned with the speed of code that may process the data once loaded.
First of all, take a look on File size, here is detailed Performance measurements

How to manage the data without database? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
In my folder having many photos. I want to create photo comment. its like orkut. How to manage the commented data without db as per image.
You can use XML for storing comments. Why not use DB? Managing XML files for large number of photos will be pain. You can try out SQLIte which is compact and will serve your purpose.
Check out SQLite. Its a lightweight database that lives in a single file, so you dont have to set up a database server, but you get to leverage all of the sql libraries out there and quickly build up your system.
I would put the comment into the vb++ image metadata processor and store the comment in binary format with the encryption in side the image with the comment. You could even put the link to the image in the metadata for the image so you can find the image from the metadata.

Categories

Resources