I am trying out Windows Live SkyDrive, and I installed SDExplorer (http://www.cloudstorageexplorer.com/)
It works by adding my SkyDrive folder to Windows Explorer, but it does not get a drive name or anything, so how can I access that drive/folder from my C# application?
When I go into the folder and look at the address bar it says "Computer\SDExplorer".
Directory.GetDirectories(#"\Computer\SDExplorer") does not work, because it translates to "C:\Computer\SDExplorer".
I would like to be able to create a small application that can create folders and upload files to my SkyDrive account.
Anybody know how these special folder/drives work? - I noticed MozyHome appears in the same way in my Windows Explorer.
Some background info: http://www.technospot.net/blogs/how-to-create-a-system-folder-in-my-computer/
The SDExplorer folder is a system folder. You can find it in the registry at the following location
HKEY_CLASSES_ROOT\CLSID{0016CE0E-728C-4FC9-98E5-D0B35B384597}
Instead of using shell32.dll it uses C:\Program Files\SDExplorer\SDShellNSE.dll,0 with the parameter a0800018 instead of a normal path.
If my assumptions are correct, the folder location is hidden somewhere in that DLL file. I had a look with a hex editor but could not find anything useful.
Thanks a lot for your replies. Because I am interested in how this works I will try to dig a little deeper. Thanks for pointing me in the right direction.
I have managed to build my small application (made it into a service), which can create folders and upload files to SkyDrive. I did this without SDExplorer, and instead I used the SkyDrive .NET API someone build here: http://skydriveapiclient.codeplex.com/
Greetings
Søren
Related
As you could guess, I'm an absolute beginner to Visual Studios and C# Windows Forms (.NET Framework). I want to transfer my project from my laptop to my PC but I have no idea how to do so. I've been trying for quite a while but can't seem to get what files to copy. I'm copying the [Name].cs , [Name].Designer.cs and [Name].resx files but I can't seem to get them to work. should I copy the whole folder or .sln file or what?
Could anyone help me please?
Copy the whole root directory where the .sln is or .csproj if it is a single winforms project.
On the destination computer you might need some prerequisites.
If you want to be able to work on it and update it from both places, use GitHub and make a private repository. That's an easy way. The other way is follow the file path: C:\users\admin\source\repos and find your project in that list of folders. You could copy it to a flash drive, if you wanted to do it that way.
I have students in high school who have created some programs using Visual Studio C#. They created some games and would like to now upload them to the web. I am pretty new to Visual Studio C#. I thought after a program was "built" that you could go into the bin/debug folder and get the exe file for the program and be able to play the game without having to have Visual Studio on the actual computer you are playing it on. It works with some of their games but some of them, there are graphical files that are missing in the exe file if all the other files aren't stored in the same place. How can I get a clean exe of their game? Can that exe be loaded up onto a web server so they can play it from there or at least download it from there?
Microsoft wrote a guide on how to do exactly this. It's on their MSDN website, which is sort of like the developer back-bone for a lot of Microsoft software and documentation.
Old guide: Adding and Editing Resources (Visual C#)
Newer guide: How to: Add or Remove Resources
The gist is that the program needs to know where the files are, relative to the location of the compiled binary (in this case, an .EXE); There's several different ways to do this, depending on your level of expertise. I would suggest that you take a look at the guides above to start that journey.
there's a few ways of doing this. (Also, make sure you're creating a 'release' build when you compile).
You can include resources in your game by creating a resources file. This is something I usually do only on winforms applications etc.
If you have on-disk files you need to distribute those on-disk files along side your game. You could do this by zipping up your game.exe and the /files/images.img folder (or what ever your resources content folder is named).
If you're feeling adventurous you could create a 'deployment project' which is a project that allows you to create an installer file. This is a bit more work however you will have fine grained control over what files go where etc.
Good luck!
EXE files generally aren't self contained for video games with many resources, just add resources in an external folder and make sure the paths to the resources in their games are not absolute but relative in the local directory.
So for example:
get rid of paths like C:/Users/Bob/Desktop/Game/Images/player.png and replace with /Images/Player.png.
Also, an EXE generally doesn't run client side on webpages, it is possible but difficult. Things such as Flash are made for this sort of issue. I'd say make the webpage a place where they can download their games. Github has a nice way to do free websites called gh-pages. OFC, you could host one yourself but that would require a lot of setup work.
Like Monza said, you can zip up the files for download. Or, you could create an installer if you wanted to be really ambitious.
I thought after a program was "built" that you could go into the bin/debug folder and get the exe file for the program and be able to play the game without having to have Visual Studio on the actual computer you are playing it on.
That is correct, given that the other machine has the necessary .NET framework version installed AND any other resources like .dll files and config files are also present. When the application is ready for release, you can set the Build options in the project properties to Release, and then when you build all the files needed for distribution will be in the bin\Release folder.
It works with some of their games but some of them, there are graphical files that are missing in the exe file if all the other files aren't stored in the same place.
This may depend on how the application was written. If resources like pictures are embedded in the assembly then those files will not be needed to run on another machine. If the application is using hard coded paths for the image resources in the source code, then the application will likely break if the necessary files aren't present when the .exe is executed.
Can that exe be loaded up onto a web server so they can play it from there or at least download it from there?
Yes - you could upload the .exe to a file server to make available for a download, but you would not be able to run it within a browser over the web. I would recommend zipping up the .exe and other files needed and hosting the .zip file on the web server for download; browsers may give a warning or block downloading an .exe .
Hope this explains it a little bit for you.
I have just created a Windows 7 Desktop Application that allows you to essentially record your screen. I have included all the resources. I am treating it like a "load from CD" type app, as it requires some files as resources. When executing the files to the folder I have made on my desktop, I obviously get the Application files folder, with the manifest and DEPLOY files in; along with the ClickOnce.exe launcher. I then also get the DVD/CD setup.exe file and another clickonce app.
Which installer should I use? And why am I getting these errors? See Below:
When clicking the setup.exe, I receive this error: http://pastebin.com/kgXSnMJY
When Clicking the Clickonce app I get a similar error: http://pastebin.com/1CCT1CKx
What could my issue be?
I managed to avert this, by compiling the files like a "release" inside of a debug. The issue was with the resources I was using, the .dll's did not seem to download correctly (at least I don't think so). Thanks for all the advice and help :)
I have an ASP.Net website and a C# console application (both developed in VS2010). Both upload files to our web server (Windows Server 2003/IIS 6.0). Users logging in to the website can then view and download these files.
This works fine in website. But when I try to download files uploaded by the console application, I get the error:
UnauthorizedAccessException
Access to the path 'C:\xxx\yyy\zzz\abcd_20120309.pdf' is denied.
I have already manually provided "Full Control" to NETWORK SERVICE account for that folder.
Why is Asp.Net code unable to access a folder created by the console application?
Any idea?
Thanks!
You need to provide access to the folder for IIS_IUSRS (or something along this line).
AKA you need access for IIS.
Including access to everyone, doesnt include this user. So it must be done directly.
Network service will not suffice.
If IIS_IUSRS doesnt appear in the list, search for it.
Don't know if it matters in this case but one thing I have seen in the past is:
The application first saves the file in a temporary folder and then moves it to the target folder.
Sometimes, don't know the exact rules, the file access right follows the file in the move. i.e. the file ends up with the access rights for the temporary folder even in target folder.
Check the access rights on the file and see if it differs from the target folder.
I've created a winforms appliction and i need to check if .NET4 installed on the machine before starting the application.
im using the "Publish" option, it works great BUT im looking for a way to define the temporary folder where all the application files will be extracted to
the current behaiver is that when im starting the files that the Publish created ,it extracting all my application to :
C:\Users\shacharsa\AppData\Local\Apps\2.0\057V8G8X.MXV\6482W7L5.25P\smar..tion_30394eeddffd8a96_0001.0000_5bb050675a14dcbe\Files
and i want it to extract them to c:\temp
thanks,
shachar.
You can't define the location, however a better solution to your problem is available. You should read up on the ClickOnce bootstrapper and using that to detect and install prerequisites.
You can't do that, it is part of how ClickOnce works, its security model will not allow for that to happen.