Solid Hosting // Blog

This is not intended to be a typical company blog. Surely, we may occasionally post some materials related to our web hosting services;
but most of all, we'll try to turn this into a helpful online resource, covering various topics in different areas of IT.
HOME // Programming

CPanel tips and tricks

Since CPanel’s documentation is “perfect” and covers everything, I decided to post some tips and tricks here. Javascript: CPANEL.utils.toggle_more_less – function(toggle_el, text_el, state): toggle_el: couldn’t decipher at a glance what this is for, I use this, as per some CPanel pages’ code text_el: the id of the DIV to toggle state: either “more” – to...

Set file/folder permissions during an MSI installation in C#

Problem: a Windows Service is designed to run under the Local Service account with minimum privileges on the local computer. Suppose, however, that the service needs to write logs/what have you locally, so we must create a folder for it to write to (usually in its Application/installation folder), and set the appropriate permissions to it....

How to customize Opencart’s search

The default OpenCart search is rather simple and can only search in the products’ names and descriptions. This limits the user in finding the desired product, which is a bad thing trade-wise. And this is where this article will come in handy, since there is nothing on the internet that even comes close to a...

Starting a process in any given Windows Terminal Session via C# and P/Invoke

(All code, presented here, is available at the end of the article as a ZIP file for download. As such, some definitions and declarations might be omitted, for brevity. This is why references to P/Invoke are NOT made, as all the definitions are already inserted in the code) An interesting problem came up one day,...

A simple way to update a Windows service (C#)

In a recent project of ours, the problem how to update a C# windows service arose.  We came up with a pretty simple way of doing it all. Here is how: There are three issues to tackle here: How to check whether a new version is available. How to download the new version How to install...

How to change an ASP Membership user’s password without knowing the old one

A project of ours required a user management interface to be implemented on top of the Membership framework, which required that the user in an “admin” role be able to change any user’s password to a new one (typed in by the admin). The ASP Membership framework offers the handy MembershipUser.ChangePassword(String, String) function – http://msdn.microsoft.com/en-us/library/9d5bh3ec.aspx...

How to cancel a postback/form submission via javascript

Sometimes one wishes to have a javascript, attached to a button/link/what have you, on a page that will, in some cases, cancel the postback/form submission. All one needs to do is simply set the control onClick (or OnClientClick, in the case of ASP.NET) to return SomeFunction(); and then return true or false in the function,...