Is it possible to use TrueCrypt through another application? (C#) - c#

I have just started using TrueCrypt and I am wondering if it is at all possible for me to write a console/forms app that will allow me to interact with truecrypt. It would be using C# in Visual Studio 2010 with Windows 7. I am just wanting to know if I can do it. If anyone has done it before or knows if it is possible I would appreciate some input.
Thanks,
Stuart.

I did look (very briefly) a few months ago, and it seems that TrueCrypt has no API other than the command line.
See this question: https://stackoverflow.com/questions/1315677/is-there-an-way-to-programatically-read-a-file-from-a-truecrypt-disk-into-memory as well.

Related

C# Auto Updater

I'm currently developing a Platformer using Monogame in order to learn C# again because I haven't used it for 2 years. I'm using Microsoft VSTS to remotely have it in a Git repository.
My brothers are going to be my beta testers and before I give them the game I'd like to implement automatic updates.
I'd like to create an installer that they use to install the game but after that the game automatically checks for updates at launch.
Is it possible to do that using Git as version control and only download changes every time it launches instead of a complete reinstall?
How would I go about doing something like that? I've googled a lot but haven't found a good answer yet. This is something I wanted to do years ago when using C# as well but never found a solution.
Any help would be appreciated!
Thanks in advance!
Try clickonce.. it may help you.if you are trying to do automatic update on client installation whenever new version is deplayed in application server or network share

Console apps like cmd edit

Is it possible to create console apps like the Edit app in CMD with visual basic or C#? I want the program to respond to mouse input, have menubar, mssgboxes and windows.
Yes, this is possible! Instead of doing it completely from scratch, check out Curses Sharp. It is a wrapper for the curses library, which helps in building applications like this.
I must admit though, I have never used it. Please let us know how it goes.
Console API provided with .NET is not suitable for that sort of development. You'll need to do lots of P/Invoke to the platform console API. I would really suggest WinForms/WPF if you need GUI.
If you really want to do it anyway, you'll need to implement low level mouse/keyboard hooks. This will get you started: http://blogs.msdn.com/b/toub/archive/2006/05/03/589468.aspx
If you want it to run on DOS, you can't (because C#/vb.net don't run on DOS). If you want it to run on Windows, I think you're better off using Windows Forms or WPF.
To answer your question; it is probably possible but it would take an enormous amount of work and for the above reasons I don't think it would have any payoff.

How to communicate with a separate application from c#

I have an .exe that runs on my computer. How can I connect to it from c#?
For example notepad.exe is running. I would like to write in notepad from windows form app or console app form. How can I do that?
Two suggestions:
either start the process using Process.Start()
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx
or use SendKeys from Windows Script Host
http://msdn.microsoft.com/en-us/library/8c6yea83(VS.85).aspx
It depends on exactly what you want to do. Using SendKeys is the simplest solution but it's crude and limited in functionality. You can do more and better with SendMessage, but this will be harder to code.
Have a look at this tutorial. As far as I can tell, it does exactly what you are looking for. I realize it's in German, so just look at the source code.
Reading from another process in windows is problematic to say the least. We did some work on this a while ago and it involved hooking into the low-level Win32 API using assembly language. Essentially, it's really not pleasant and if you can avoid doing this you'll have a lot more hair on your head.
Using SendMessage would work if the application you are sending to understands the message you are trying to send to it. I suspect that you start to get into security problems with this on later Windows versions (Vista + Win7) and would have to run your application with elevated privileges.
Why do you want to do this?

An embedded application for windows desktop using .NET platform?

I'm rebuilding an Embedded application:
Prebuild application Specifications:
Use : For dispaying the captured images/video from microscope image capturing device on windows based PC or Laptops.
Sepcifications: Prebuild on .NET plateform using VC++
Flaws : Lacks some specified features.
Current Requirement:
Want to rebuild that entire application using C# and add some additional client features.
My Questions:
Is it feasible to develop such application in C#.net?
If yeh,What kind of resources available in C# to develop desktop embedded application?
Any references which show any of such kind of application?
Your suggestions on building this kind of application.
P.S. It is essential to buid it on .NET platform.
I think by "Prebuild" you mean "Existing". Why do you want to rewrite the complete application? As you have stated that the application is written in C++.Net. You can easily add all the new functions in C# and use that code from your existing C++.Net code.
Note: I'm making this answer CW because the question is hard on the limit towards some close reasons. Everyone feel free to edit and extend it.
Is it feasible to develop such application in C#.net?
That's a tough one...from the top of my head I'd argue that it doesn't matter. If you know C#, then build it in C#, if the client wants it in C#, then build it in C#. You'll most likely have to use COM-Components or API-Invokes anyway to accomplish this.
If it is a TWAIN device, you might be better of to stick with VC++, I found TWAIN on .NET a real pain in the a** and have given up on such features. Same goes for WIA, but that might just be me.
If yes, what kind of resources available in C# to develop desktop embedded application?
I guess you mean a Widget? In that case I have no idea, I never really looked at that (at least not on Windows). But as far as I know widgets on Windows consist of a data-backend and a HTML/JavaScript-Frontend, so you'll most likely have to develop the two separately.
Any references which show any of such kind of application?
I guess any WIA/TWAIN application would be a reference, at least your description sounds so.
Your suggestions on building this kind of application.
See your first question.

How to read installer shortcuts with C# (WPF)

Background: I've decided to teach myself C# through WPF, and I'm writing a small application that needs to get a list of Start Menu shortcuts and their targets and store them. Basically, I'm trying to take all the shortcuts and put their target applications' paths into memory. However, I've run into a problem trying to read Windows Installer shortcuts (the ones that point to something like C:\Windows\Installer\{90120000-0030-0000-0000-0000000FF1CE}\wordicon.exe -- Microsoft Office is a good example of this). I did some research and it seems that Windows uses some behind-the-scenes magic involving the Registry to find the actual location of the file.
Question: How can I get the actual target of these Windows Installer shortcuts in C#? A lot of sources I've found point me to the IShellLink interface, but I don't know how to use it with C#. I'd prefer to use Windows API calls (or, even better, a .NET library) instead of manually looking through the Registry, but I'll take any guidance on the issue.
After doing more research, I found an easy answer here. It's basically using a combination of the MsiGetShortcutTarget and MsiGetComponentPath functions of msi.dll.
I'm afraid IShellLink IS the Windows API for using shell links! The Shell API is heavily COM-based.
But the good news is that COM interop works very well in .NET. This site is usually a very good resource:
http://www.pinvoke.net/default.aspx/Interfaces/IShellLinkA.html

Categories

Resources