June 2005 - Posts

Outlook Add-in Support in Visual Studio 2005 Tools for Office

Technical Articles

Downloads

with 0 Comments

Isolated Storage: How to clear the Isolated Storage?

As part of the .NET Framework 1.1 SDK there comes the Storage Administrator Tool (storeadm.exe) which helps you view and clean the Isolated Storage.

storeadm [/list][/remove][/roaming][/quiet]

Option Description
/h[elp] Displays command syntax and options for the tool.
/list Displays all existing stores for the current user. This includes the stores for all applications or assemblies executed by this user.
/quiet Specifies quiet mode; suppresses informational output so that only error messages appear.
/remove Permanently removes all existing stores for the current user.
/roaming Selects the roaming store. Use this option with the /list or /remove options to specify that the action should apply to the roaming store.
/? Displays command syntax and options for the tool.
with 0 Comments

No-Touch Deployment FAQ now available as Smart Client (using No-Touch Deployment technology)

The No-Touch Deployment FAQ is now also available as Smart Client using No-Touch Deployment in the .NET Framework 1.1 to run safely from my website.

Enjoy!

with 0 Comments

Isolated Storage: How to determine if a file exists

// Get the desired store

IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForDomain();

// Check if file exists

bool fileExists = isoFile.GetFileNames("TheFile.txt").GetLength(0) != 0);

Developing for the default internet permission set in .NET 1.1

After a lot of work with No-Touch Deployment in FullTrust corporate environments I wanted to try how useful it can be used in the Internet with the default internet permission set applied. My first and ambitious goal was to create a small app like notepad. And since .NET code that comes from the Internet (theoretically) cannot harm your computer I called it SecureNotepad.

SecureNotepad is a Smart Client using No-Touch Deployment. If you have the .NET Framework 1.1 SP1 or above you can run it online.

Experiences implementing SecureNotepad

Saving Settings in the Isolated Storage

Since you obviously cannot randomly write to the local machine’s hard drive there is place called the isolated storage where you can save data you have to remember across application invocations. The bad news: The default maximum storage size is 10240 bytes (!!) for the Internet Zone (it’s unlimited for Intranet). So it’s just enough to maybe save the last user name in some sort of login dialog or something similar. However in .NET 2.0 the default quota will be increased.

Opening files

There is an elegant way to be able to open a file – selected by the user – without directly getting in touch with the file system. You can use a FileOpenDialog that will return a Stream you can read from. In the code you will not be able to determine what the file’s name is or where it is stored. Since we never get the real filename on the disk we have no file title to display in the title bar.

Big drawback: For some reason this procedure does not work for saving files to a user-selected location. It’s just not possible. :-(

No Hyperlinks

There are no way to open up a browser window with a specified URL.
Note: In .NET 2.0 you will have permission to host a managed browser control

No Clipboard Paste

You can copy things into the clipboard, but pasting is not permitted.

Dialog Parents

You may not explicitly set the parent form like this: frm.ShowDialog(this). Instead use: frm.ShowDialog();

Form Appearance

All Forms in your application…

  • … will have a yellow security notice balloon tip that will popup after showing the form informing the user that the application is running in a partially trusted environment.
  • … will have the Zone and the Webserver Domain in the Title according to the following schema: [zone] - [your title] - [webserver].
  • … will have a minimize and maximize Button that cannot be turned off (the corresponding properties are ignored).

Conclusion

An application as simple as Notepad is not possible to be developed with the default Internet permissions. Awful. "WHAT IS IT GOOD FOR THEN?" you will understandingly ask...

Well, one thing that works very well with the default permissions are connections to web services (on the same server as the application resides). That opens a wide range of interesting possibilities for internet applications.

Just to name a few that come to my mind:

  • File uploading
    Could be embedded as WinForm control into a web page with nice progress indication and error handling.
  • Complex questionnaires or votes
    Could have a Wizard that collects a whole bunch of information from the user, validates them and at the end sends it to a web service.
  • Tools that require online data and do calculations on the client
    e.g. Unit/Currency Converters
  • Content Browser
    Present your data in a richer and more sophisticated UI. Check out the No-Touch Deployment FAQ as a good starting point.

Future Developments

And not to forget: .NET 2.0 will extend the default permission set (more space in Isolated Storage, managed browser control support) and future versions (especially in combination with the next version of Windows client) will continue to do so.

with 0 Comments