Запись карты памяти портативных приложений в C#

Я заканчиваю этот вопрос с помощью

.append("svg:tspan")

и заключаю текстовую ссылку Обтекание текста в D3

7
задан CodexArcanum 22 April 2009 в 16:32
поделиться

5 ответов

  • 1) Проблем быть не должно запуск приложения .NET с флешки диск.
  • 2) Вы должны контролировать большинство пишет. Обязательно пишите Temp или другое место на жесткий диск, а не на флэш водить машину. Но циклы записи не должны быть проблема - даже с умеренной до тяжелой использование большинства флэш-накопителей имеют жизнь время лет.
  • 3) Просто относись к нему как это любое приложение, которое имеет xcopy стиль развертывания и попробуйте к аккаунту для вашего приложения изящно терпит неудачу, если некоторая зависимость отсутствует в окне.
10
ответ дан 6 December 2019 в 15:31
поделиться

Если вы хотите использовать com-объекты, используйте reg-free com и включите com-объекты в вашу программу.

2
ответ дан 6 December 2019 в 15:31
поделиться

You should always have control of your writes. Applications should be loaded into RAM at startup, and then memory past that is allocated in RAM, so nothing is written to the flash drive.

The most important thing for a portable application is that basically no installation is necessary for your application. You do not want to be dependant on registry values especially, since your application will not be 'installed' on other computers.

One of the issues with portable applications you may consider is data persistence. Generally, you write to a user's Application Data folder to save data. If this is the case, any data saved will only apply to the user on that computer. If you want some local application data, you may wish to create a Seralized XML file for your settings and store it locally within your application's directory. This file writing would then likely be the only write actions you'd need to worry about.

For your .NET portability issue, you could also write a small entry program in C++, which checks if the computer has .NET installed. .NET has registry values you can check to see the versions installed, so if .NET is installed, run your application, else display a message stating that .NET needs to be installed first.

Edit: I'd like to add that I do application development for Ultrasound machines using XAML in C# 3.0. The application I write works perfectly from a USB Flash Drive, while all user settings are stored on a local AppData basis, so nothing is written to the USB. While the application can be installed through an .exe installer, the installer does not write any registry values the application depends on.

2
ответ дан 6 December 2019 в 15:31
поделиться

У меня нет ответов на вопрос № 1 или № 3. Но для # 2 .NET CLR не следует записывать в папку «установки» приложения (т. Е. На флэш-диск), если ваш код специально не сообщает или не использует и не изменяет настройки на основе файлов (ini, xml и т. Д.) которые живут с приложением.

Номер 1 - действительно кикер, если вы не просто пишете вещи для личного использования. Очевидно, что размещение переносной копии полной CLR на флэш-накопителе невозможно. Но есть инструменты, которые могут сканировать вашу сборку на предмет ее зависимостей и упаковать их в отдельный .exe-файл, так что CLR не обязательно нужно устанавливать в целевой системе.

0
ответ дан 6 December 2019 в 15:31
поделиться

I don't actually have any experience with this so it might be best to take what I say with a pinch of salt. But here is my take on it:

You don't need to do anything special.

It is not really a consideration of an application developer as to how and when writes are made to a drive, that is something that is far better controlled by the OS. I know that Windows caches writes to USB drives so I would trust it do handle that.

The only thing you need to consider is that your application will not be installed. So you need to make sure that you design it to run entirely self contained within the directory it is deployed to. You could optionally also make some writes to the users home directory but this needs to be done through the appropriate environment variables.

I would get writing and see if there is anything special about a flash drive that the OS doesn't handle.

0
ответ дан 6 December 2019 в 15:31
поделиться
Другие вопросы по тегам:

Похожие вопросы: