Welcome to MSDN Blogs Sign in | Join | Help

Rahul Soni's blog

Never assume the obvious is true!

News



  • These postings are provided "AS IS" with no warranties, and confers no rights.

Browse by Tags

All Tags » Samples   (RSS)
Run a batch file as a specific User (or Administrator) from ASP.NET...
...well first of all, I am NOT recommending it, but sometimes it could be necessary! Now, let's proceed to the code... 1. Create a page called RunBatchFile.vb and paste the following... Imports System.Diagnostics Imports System.IO Partial Class RunBatchFile Read More...
A sample to help in other samples related DataSource
There are quite a few times, when I get an issue related with a specific DataControl and I want to bind it to a datasource. All geared up and with full enthusiasm, I start dealing with the issue... and DARN... I find that I did something awfully bad with Read More...
Dim browser As SHDocVw.InternetExplorer does something different in Vista
First of all, I wouldn't pretend to know something which I don't. But this is kindda interesting... I got a comment on one of my previous posts from Boyd who was seeing a weird error on Vista. He had an application with the following code... Sub test() Read More...
Enable wrap and change the color of Listbox items
Problem description> You have a Listbox where you have a lot of items which are quite large and won't fit inside the width of your listbox. You don't want to enable Horizontal Scroll bar, since you have don't want your users to keep scrolling left Read More...
Change the border color and style of PictureBox in VB.NET
You know that by default you don't have too many options to change the Border Color/Style of a normal PictureBox control. I wanted to customize this control a little bit, so that you can at least change the border color and style when you click on any Read More...
Read or Write Resources from/into a DLL in .NET 2.0
I created a Windows Live Writer plug-in for inserting Smileys a while ago. It depends on a TXT file which was initially present under Application Folder + "\Plugin" folder. Recently, due to design changes in the beta version of WLW, the plug-in started Read More...
Sample page in ASP.NET to show you different collections like Forms, Querystring, Cookies etc
Sometimes, while troubleshooting I am interested to find out all the details about certain collections in ASP.NET, like Forms, QueryStrings, Headers, ServerVariables, Cookies, Sessions and Params... I created a very simple aspx page which would show you Read More...
Create Windows Live Writer plugin using Visual Basic.NET
Windows Live Writer is cool! I use it to create my blog posts and of late, I wanted to make my blog a little more colorful. I was looking for the plugin which could do what I want (just too many things in life!) but couldn't find it. That's why, I decided Read More...
Using Forms Based Authentication in ASP.NET for Static Content (Doc Files, PDF Files etc.)
Scenario: You want to implement Forms based authentication for ASP.NET web application, and you have certain document/PDF files which need to be protected. It should be such that even if you try to browse that .doc file directly, it should take you to Read More...
How to get the Folder Size in VB.NET
My problem was not really big, but it was a problem which really irritated me a lot!! We store data based on the user's alias in a folder called D:\SomeFolder on remote machine. In due course of time though, the hard disk starts giving No Disk Space problems, Read More...
Using System.Management to get information about the Operating System from your VB.NET Application
I blogged about how to find Operating System Information from your VB.NET 2005 application last year in March. I found that Nilesh has posted a very nice reply to that post to ensure that the output of that program is even better. Initially, if you used Read More...
A sample aspx page to show the security details
This is a pretty small sample to help you figure out the ASP.NET identity matrix and how it comes in effect. I am posting this since quite often we need to troubleshoot security related issues on a production website and making any Application level changes Read More...
Customize errors which are not captured by customErrors in ASP.NET 2.0
Yesterday, I came up with an interesting issue where a customer wanted to customize a 500 error message ("Internal Server Error"). Interestingly, customErrors DID NOT seem to work for StatusCode 500! We just wanted to verify if it works for 404, and it Read More...
Compare file versions and other important details on two different boxes
Quite often, we hear that two boxes are completely alike but for some reason a program that works on first just fails on another. Sometimes, you suspect certain patches which got applied on one box and not applied on the other box might have been the Read More...
How to read User and System Variables using VBScript
Quite easy! Dim objWSH Dim objUserVariables Dim objSystemVariables Set objWSH = CreateObject("WScript.Shell") 'This actually returns all the User Variables, and you either loop through all, or simply print what you want Set objUserVariables = objWSH.Environment("USER") Read More...
More Posts Next page »
Page view tracker