I need to implement a Windows Virtual Disk that is visible as a separate disk device in Windows Explorer and transfer all files/dir transferred forth and back to a remote WebService - sth like a DropBox.
Do I have to implement/use a kernel driver SDK? Or is it possoible to use only shell extensions? What I need is to intercept all file/dir operations on that disk and map them to a corresponding WebService calls (file creation/deletion/move/edit and data transfer).
Thanks
You will need a combination of kernel-mode driver and Windows Service/Application for that:
http://dokan-dev.net/en/ (free)
http://www.eldos.com/cbfs/ (commercial)
Windows 7+ allows you to mount a VHD as a disk. The API is described in this MSDN article -The Virtual Disk API In Windows 7.
I don't know if it's possible with just shell extensions, but scanning the article I see the API AttachVirtualDisk, and you should be able to P/Invoke that.
Have you considered WebDAV? This wouldn't require you to install anything on the client, since the functionality is integrated into Windows (I believe since XP). It is using REST, so you could even implement it yourself or look for a solution on codeplex. If it is just about remote storage, there is an IIS addon you can use for that (I believe it is build for IIS 7).
You can go with namespace extensions, this is what DropBox does. Wuala and some other cloud storage provides, on the other hand, use our Callback File System to create a virtual disk.
Related
I have a Windows 10 universal app that is running on a Windows 10 Mobile device. I noticed from the Windows 10 Mobile device, it does have a file explorer but it limits you to only see certain "Known Folders" such as music, documents, downloads, etc... and that is all.
Furthermore, when I plug the device into my development machine via USB, I can browse the device but again, only the Known Folders above.
In my app, I am writing to a log file and that log file is stored to LocalStorage, under a folder for my app name, for example:
var dataPath = ApplicationData.Current.LocalFolder.Path;
I simply need to browse MY LOG FILE, that MY APP CREATES, in MY APP FOLDER. I read about a ton of, in my opinion hacks, to get access to this file/folder. For example, there are some third party applications that still mainly claim to target Windows Phone 8/8.1 but will still technically work for 10 such as:
Windows Phone Power Tools
Isolated storage spy
etc....
Then I also read articles on how to use a file in Pictures (or voice recording) and go to file properties to then gain access to the root or to create a root shortcut on the development machine and copy it to the mobile device, however, these are typically a year or more old and no longer work on my device (I suspect MS patched these hacks).
So, all that said, I would like to see a good way to access the root drive for development, or at least my app folder in the LocalFolder so I can access my files (such as logs or the sqlite db file). Maybe there is a way already but my google searches haven't turned anything up just yet.
Thanks!
As you've known, we can use some third party tools like IsoStoreSpy or Windows Phone Power Tools to access Isolated Storage. Although they are designed for Windows Phone 8 & 8.1, but they can also be used for Windows 10 Mobile. With these two tools, we can access LocalFolder, TemporaryFolder and RoamingFolder. For more info, see similar question: Accessing storage of simulator/device while debugging.
Besides these third party tools, there is also build-in support in Windows 10. We can use App File Explorer to view and manipulate files stored by your sideloaded apps. This is a new, cross-platform version of the Isolated Storage Explorer from Windows Phone 8.1. This tool should be able to work no matter your application is deployed in Debug mode or Release mode. But please note that this is a new tool added to Windows Device Portal in the Anniversary Update.
To use this feature, we must enable Device discovery and Device Portal. Then we can access application storage in web browser like following:
For more info, please see Device Portal for Mobile and Using the App File Explorer to see your app data. Also the similar question: Windows 10 Mobile: how can I see inside on my app folder? might be helpful.
I had a similar problem to solve few months back. I ended up doing two things:
I've implemented a 'Send Logs' button in settings that would upload logs to a ftp server. Actually it was a bit more than that, all installations of this app were managed by a central server and there was 'Get logs' button on the server side that would send request via push channel to the device to get the logs.
Got my hands on a Interop-unlocked device that I would use if the app was in a state that would make first option not possible.
Hi
I would like to retrieve documents from an ftp in my Windows phone 7 application (built with XNA in my case).
As far as I understand WP7 does not support ftp due to port and protocol(?) contraints.
Is there any way to get ftp support working?
I guess I will be able to implement it my self once socket support is added but I dopn't wan't to wait for that.
Cheers
/Jimmy
Since there are no supported socket capabilities in the initial release of WinPhone , you cannot directly FTP. You would have to create an "FTP Proxy" web service which your phone would call and have the service do the actual FTP and relay the files.
FTP and Sockets are not supported by the platform at the moment.
If you want to get remote files on to your phone you'll have to use HTTP(S).
You can do this either with the HttpWebRequest or WebClient classes depending on your specific needs.
Do you want to retrieve files fromn the phone, and over the cellular network? If so you need to confirm your operator allows ftp connections to your phone, which they probably do not.
If you're connecting over wifi, you've got more chance of this working.
Otherwise, you could implement a dropbox-style approach where the phone and your file-retrieving application both connect to a remote server
If this is for development purposes, you can get access to the phones storage and copy in files by using Microsoft's SmartDevices API.
I'm trying to do the same but so far the only way I've found around it is to create a web service to run on my own server which retrieves the FTP files on behalf on the phone.
Wish MS would hurry up and give us sockets - calling a web service is fine but I'm pretty sure it would be slower than directly getting the FTP files from the phone itself.
I'm planning on writing a small program that uses the .NET framework to read disk capacities on remote Windows PCs.
I normally write in C#, so I'd like to stick with this. A number of us in our department need access to this program.
Should I write this as:
a desktop app
an MMC snap-in
an ASP.NET application with a service?
Any suggestions? Many thanks.
A different idea, what about a PowerShell cmdlet with WMI?
A service with WCF comes into my mind. Thus, a central application could query the service on each remote windows PC to get the information.
If these PC's already publish their disc capacities in some form (eg. via windows shares or something else), you could omit the service part and directly query the machines.
WMI already publishes this information. So all you need is a client. Depending on the needs of your users, it could be a WinForms app, an MMC SnapIn, a console app, etc etc.
I am using Visual Studio Team System 2008, C#, .NET 3.5, IIS 7.0, and ASP.NET. I am using Silverlight 3.0 as well. I want to read the content of a USB flash disk at the client side, using the information in the USB flash disk as a user profile identifier -- just like an online bank service is using a USB key to store a client certificate (but my security requirement is not that high).
How the content of a specific file in a USB flash disk in a web application (at the client side) be read? Could we do this in Silverlight (if can not, any alternative solution to read USB flash disk content)?
BTW: I want to read the content automatically, and I do not want the user to manually select the specific file on the USB flash disk to read.
You can not do this in Silverlight. You can read a file on the user's machine, but not without user intervention. The security model built into Silverlight will not allow it.
The best you can do is to read a user-specified file is to have them browse to it with a
file-open dialog box.
You can access the USB/flash drive if you are using a console/Windows Forms/WPF application locally. You can find the drives using the DriveInfo class, then iterate over them or use a LINQ query to find the drive you want to access. See the Stack Overflow question "How to find USB drive letter?" for details. Once you have a path, you can search it for the file you want. You do not need a special API or library, the Windows OS treats the USB drive as a normal drive, same as a "permanent" HDD connected to your system, and will do all the dirty work for you at that level. Just use the .NET I/O classes. However, if you wish to access the drive in an independent manner that does not depend on any OS, then you should use a 3rd party library.
I don't think what you're asking for is possible. If it IS possible, that's scary stuff... To allow a web site to grab stuff without user intervention? Uh-Uh. No way.\
Edit - Added after reading the comment
Using only the standard framework, no. USB support is not something that comes standard. You'd think there would be some classes in the System.IO namespace for USB ports like there are for COM ports, but no such luck. However, there are some libraries that will handle this. Here are some links to get you started.
http://weblogs.asp.net/israelio/archive/2005/08/15/422637.aspx
http://www.icsharpcode.net/OpenSource/SharpUSBLib/
Lately I've been reading up on HDFS (Hadoop) and GFS (Google) and find myself wondering if there are any similar native implementations for windows and/or .NET. A lot of the applications I develop include features to support user generated content, and currently, that means relying on some type of storage service such as Mosso or S3, or resorting to some type of NAS in my server farm. I'm interested in a setup that would allow me to mimic the Mosso or S3 style of storage locally so that my files are automatically stored on multiple machines and have high availability.
Is there anything that serves this need for C# besides Windows' built-in DFS (which requires Active Directory, which isn't running on my server farm)?
Open AFS, SQL Data Services or just run Hadoop on windows?