AnJ Inc’s Weblog

The Evils of Some Programers

Gmail Scam!!

Read article at TechCrunch 

March 10, 2008 Posted by anjinc | Uncategorized | | No Comments Yet

ProcessStartInfo anomalies

I have found that trying to run an application as a different user in .Net is not as easy as I had thought.  This has spawned off the fact that in my previous post, I had decided to start creating a Windows Service to autolaunch the billmind.exe application under the Administrator credentials.

Consider the following code:

 

With myProcess
    .UserName = "[insert user name here]"
    .Password = "[insert password here]"
    .UseShellExecute = False
End With

it looks correct except the myProcess.Password value has the following error:

Error    1    Value of type ‘String’ cannot be converted to System.Security.SecureString’

So I thought to myself, ok I will just create a new variable and declare it as a SecureString and pass that value.

Dim UserPassowrd As Security.SecureString
UserPassowrd = "[insert password here]"

Still no go, Security.SecureString will only accept a SecureString value.  Trolling through the net finally netted the following code to convert a clear text string into a secure string.

 
''' <summary>
''' Converts cleartext password into SecureString Password
''' </summary>
''' <param name="UserPassword"></param>
''' <returns>SecureString Password</returns>
''' <remarks>.Net SecureString does not accept standard string inputs</remarks>
Function ConvertToSecureString(ByVal UserPassword As String)
 
    Dim retPassword As New SecureString
 
    For Each c As Char In UserPassword.ToCharArray
        retPassword.AppendChar(c)
    Next
 
    Return retPassword
 
End Function

So now, with the function in place the code can now convert a different users credentials and allow it to run.

February 27, 2008 Posted by anjinc | Programing | | 1 Comment

Quicken 2008 Billminder issues

So running Quicken 2008, I have encountered issues with the billmind.exe application.  It does not run under my current user account despite being an Administrator.  The only way of running it is to invoke a ‘Run As’ command and use the Admin account.  Of course I had to log in as the Admin and point the Quicken profile for that account to use my data file.

Currently I am in the process of creating a ‘workaround’ service that will launch the billmind app automatically.

February 27, 2008 Posted by anjinc | Uncategorized | | No Comments Yet

vsAmp2 – A Visual Studio 2008 audio player addin

I have spent some time on trying to re-create a add-in that had existed in VB6 that would allow me to play audio and video files within the Visual Studio IDE while I code.

This project is based on the .NET 2.0 framework and is coded using the VSPackage integration process.

This code/solution has taught me a lot on how to write and modify the vsPackage information and how to utilized external assemblies to handle core processes of the ‘host’ application.

As a side note, I am including the source code, but you must make a base solution within VS to ‘link’ them all together. vsAmp2 requires the playlistEditor.dll from the PlaylistManager project.

Download Source code: vsAmp2.zip

February 20, 2008 Posted by anjinc | Programing | , , | No Comments Yet