How to get the isolated storage path for accessing the files and folders in windows phone7 application? - c#-4.0

In windows mobile 6 applications, I use code like Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
to get the application path.
Likewise in windows phone7 application, how to get the isolated storage path and how to access the files and folders in my application?
Please give me a sample code for develop my application.

Just use IsolatedStorageFile.GetUserStoreForApplication() to get an object which can manipulate files and directories in Isolated Storage.
See this MSDN link which has plenty of example code.

have a look here: Retrieving file path from IsolatedStorage
isoStore.GetType.GetField("m_RootDir", Reflection.BindingFlags.NonPublic).GetValue(isoStore).ToString();
^ or Reflection.BindingFlags.Instance

Related

Need help in developing a custom WebDav client using node.js

I am developing an open source application which should mount webdav share to local drive letter just like NETDRIVE and WEBDRIVE using node.js and electron-js, so in my application at present I am downloading all files from webdav share which takes a lot of time and not reliable for heavy data. Is there any other approach so that whenever user access a file, only that particular file should be fetched from webdav share, I’ve tried to display files meta data(dummy) structure in directory and kept that directory under file-watcher. So that when user tries to open a file then watcher should capture file open event to get which file was user trying to access, so that in background of application a service will triggered to fetch that particular file using file-path as reference, but none of them are unable to capture file open event. Is there any other approach to do so, correct me if I am in wrong direction.
Thank's
I think you want virtual file-system and recommend Dokan library.
Dokan is the start point of Windows virtual file-system application.
Open Source : Dokan (https://en.wikipedia.org/wiki/Dokan_Library)
Commercial: EldoS CBFS (https://www.eldos.com/cbfs)
Google, Naver use Dokan and NetDrive, RaiDrive(mine) use CBFS.

Office Add-in Internet Explorer cannot find path

I am getting started with Office Add-ins through the Java script API. I am going through this tutorial. When I proceed with the Try It Out section. I get this error. I am getting the add-in to run fine when I give the absolute path in the source location node of the manifest for example E:\Excel-Add-in-Javascript\first-excel-addin\Home.html but its the relative path that is not working for example \\SAAD\Excel-Add-in-Javascript\first-excel-addin\Home.html Kindly let me know if you a solution.
The source location node should not contain a relative path. It should use a complete path, either on the internet or on a network share.
In your case, you need to make \\SAAD a network share, not just a folder.
I don't think that serving from the file path (file:///C:/Users/username/Desktop/something.html) or share is a supported scenario. It may work, but note that it will run differently (and sometimes not run, or be overly permissive) than when you deploy the app for real.
To be clear, you can have a manifest file on a network share for ease of testing the add-in -- and in fact, it's the easiest way to get your add-in registered with Office desktop. But the web content should be served off of a web server (anything from hosting via an IIS local-host web server, to using an Azure Website, to putting your content on github and serving it via https://rawgit.com/).

Publishing a web application with an executable to MS Azure

Here is my situation, I have a web app that contains:
An .exe (which is a .net project along with assembly files and so on)
ZIPped xml files
Folders containing js&css files
Now when executing the .exe it parses the xml inside the ZIPs to create html files( the end result is a complete html that imports some of the js libraries and css files).
Considering that I have basic experience in MS Azure, I am looking for a way to have my application run on azure? My guess is that the ZIPped xmls could be stored most probably using blob storage along with the js and css files. What I am not sure of is how to get the executable running there(Possibly deploying the .exe with its corresponding resources,assemblies,dlls etc...) and have it execute from there.
If you really want to use a home grown build process (your exe) then you need to use cloud services (your own VM) where you can run this and expose your website over whatever ports you want. However it sounds like you are new to .Net, I'd suggest reading up on ASP.Net MVC Web Projects. That way you can leverage Visual Studio for building the website and deploy to a Azure Website, which is designed to host websites.

Using DirectXTK to save screenshots in Windows Store app (Metro)

I'm working on a C++ Windows Store DirectX app and I'm trying to save screenshots to disk every so often.
I am using the DirectX Tool Kit (DirectXTK) and the function SaveDDSTextureToFile which returns an HRESULT.
The problem is that the returned HRESULT is always:
E_ACCESSDENIED General access denied error.
I assume this is some permissions/capabilities thing (it being a windows store app) but I can't find what I need to ask for permission for to be able to save files to disk.
The DirectX ToolKit says it is for Windows store applications as well as desktop applications but I can't find any information on their codeplex either.
Does anyone know what I need to have permission to do for this to work?
Thanks for your time.
Windows Store apps are sandboxed and have fewer permissions than desktop apps, especially when it comes to file access. By default, apps only have access to write to the local storage directory, which isn't easily accessible from the shell. If you want to save to the Pictures or Documents library, you will need to specify this access in the package manifest. Additionally, you will need to use the WinRT file APIs to write the DDS files. To do this, use SaveDDSTextureToMemory, then write the resulting raw DDS data to the StorageFile. Check out the File access sample for more info on the WinRT APIs involved in writing this data as a file.
I've managed to find a way to do it. Basically as MooseBoys says you cannot save to anywhere because the app is sandboxed.
You can however save to the TempState folder of your apps package in AppData, which is all I need because I'm using this feature for debugging.
So the line I call is:
DirectX::SaveWICTextureToFile(deviceContext, texture2D, GUID_ContainerFormatPng, L"C:\\Users\\USERNAME\\AppData\\Local\\Packages\\PACKAGENAME\\TempState\\test.png");
And this works great.

How to setup IIS 7 using physical path directing to DropBox?

I'm using multiple computers for development and I want to be able to store my files in my dropbox folder. I went to change the physical path in IIS from c:\inetpup\wwwroot to the dropbox folder but I get this error:
The requested page cannot be accessed
because the related configuration data
for the page is invalid.
I couldn't find the config file so I was wondering if anyone had done this before or whether there a better way to sync everything nicely across several PCs?
I tried it (IIS 7.5, Win 7) and it should work just fine to let your physical path of your web look at your dropfox folder. I would guess your web.config file generally contains malformed XML (see KB942055).
I'd suggest, try to map it to an empty folder just with an index.html file and see if this error still occurs.
As a workaround, I guess you can put Dropbox in your wwwroot folder and set up a virtual directory that points to Dropbox. However, there are some security issues that may hinder you from doing so. I come across a nice tutorial on how to set up Dropbox to IIS as FTP Publishing. Hope it helps.
Hodgin's guide on using Dropbox as FTP publishing.

Resources