Using IECapt.exe with IIS,

I used IECapt to generate screenshots of user websites, to display in their control panel. Being a front-end dev, I don’t normally call a processes and envoke applications, but I was able to find some code to help me along. Unfortuatelty, I ran into some issues with permission when trying to execute the exe. While developing on my local machice, I had no trouble generating screenshots with the following sample code. public static void GenerateScreenShot(string url, string fileout){ Process myProcess = new Process(); myProcess.EnableRaisingEvents = false ; myProcess.StartInfo.RedirectStandardOutput = false; myProcess.StartInfo.UseShellExecute = false; myProcess.StartInfo.FileName = @”” + System.Web.Configuration.WebConfigurationManager.AppSettings[“IECaptPath”].ToString(); myProcess.StartInfo.Arguments = Continue reading

Javascript folder permission issue on Ubuntu, Zend

I recently deployed a Zend Framework site from my Windows Zend CE dev environment to the production Ubuntu 10.10 Zend CE server. Of course this task seems easy enough. Sure, the folder structure is different, but this should be easy as pie and work out of the box, right? Well not quite. I copied my project to /var/www/myproject, added the my virtual hot to the httpd.conf file: DocumentRoot /var/www/myproject/web_root SetEnv APPLICATION_ENV “development” AllowOverride All Order allow,deny Allow from all After restarting apache2, sudo service apache2 restart my site was visible at http://localhost/ . Zend seemed to be working. CSS was Continue reading

Accessing the web.config from a DLL

Sometimes your website (or a site someone else made)¬† will include a DLL that interface with your site.¬† In a recent project, I encountered an issue where the DLL needed to utilize the web.config to access the database. With a quick search, I encountered many others with the same problem. There was a few solutions, but none of them work out of the box. With a little tweaking I was able to make it work. In the web.config we have our connectionString: <connectionStrings> MyDBConnection” connectionString =”server=localhost;database=MyDB; user id=username; pwd=password”/> </connectionStrings> And to access it from the DLL: string connString¬†= System.Web.Configuration.WebConfigurationManager.ConnectionStrings[“MyDBConnection”].ToString(); Continue reading