.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Web Q&A: Windows Script Host, Dropdown Menus, ASP-to-HTML, and More

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

More Related Resource Links

Scripting: Windows Script Host 5.6 Boasts Windows XP Integration, Security, New Object Model


Windows Script Host (WSH) 5.6, a major upgrade for the WSH environment, provides some significant improvements over previous versions. A brand new security model that is tightly integrated with security in Windows XP allows administrators to place fine-grained restrictions on scripts reducing the risk from malicious code. In addition, local scripts can now run on remote machines, and enhancements to the object model reduce the amount of boilerplate code needed when writing professional code. This overview of WSH 5.6 explains these changes and how .NET and scripting work together.

Dino Esposito

MSDN Magazine May 2002

Windows Script Host: New Code-Signing Features Protect Against Malicious Scripts


Downloading scripts from the Web or e-mail leaves users vulnerable to security risks because scripts can't be signed. But now developers can use Windows Script Host (WSH) to hash scripts so users can verify their source and safety. With WSH, scripts can be signed or verified using all the same tools ordinarily used to sign EXE, CAB, DLL, and OCX files. This article discusses public-key cryptosystems, the process of signing and verifying scripts in WSH, and several warnings about attacks that could potentially be made against cryptographically secured scripts and ways in which to avoid them.

Eric Lippert

MSDN Magazine April 2001

Rendering ASP.NET Script References into the Html Header

One thing that I've come to appreciate in control development in ASP.NET that use JavaScript is the ability to have more control over script and script include placement than ASP.NET provides natively. Specifically in ASP.NET you can use either the ClientScriptManager or ScriptManager to embed scripts and script references into pages via code.

Writing the windows forms data to an HTML file

I have a windows forms application ready now i need to transfer data from the windows forms to the web and to do this i need to write an HTML file that contains the form data, i mean the data contained in the form should be written to an HTML file to be submitted and this HTML file should be generated on the local PC. I have the code for the HTML file but how can i write this HTML file with the data values contained in my windows forms. Please give your suggestions. Best Regards, Syed

How to use single windows service to host multiple WCF Services instances (Each instance of WCF is i

How to use single windows service to host multiple WCF Services. I have a mutiple instance of same WCF service in different folder, each instance has unique service name and port. WCFService has reference to Reg-Free COM Reference, i have Native.WCFService.manifest in each folder. Ex: WCFService1 is in "C:\WCFService01\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config WCFService2 is in "C:\WCFService02\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config Now i need host above services from single Windows Service. I am trying to create AppDomain for each above WCFService Instance from Windows Service and then host. Its working if i register COM dll in the server using regsvr32, but when i un register COM dll, i am getting unable to load COM component .... This looks like AppDomain is not loading COM DLL and Manifest files. Its looks strange but we need it in this way because we have production and test environment in the same server. Everything works fine if create a seperate Windows Service for each WCFService Instance, but my manager wants single Windows Service :). Any help whould be really appreciated.  ravi kumar reddy

Suspend / Resume Instances within Workflow Service Host (in Windows Service)

We are hosting WF 4 worklfow instances within a Windows Service that uses the Workflow Service host container.   On the Windows Service OnStart we start the workflow service host (w/ multiple WCF endpoints such as start workflow instance, cancel workflow instance, poll workflow instance status, etc.) and these endpoints create or work on one or more long running workflow instances.     My question is, if a user attempts to stop the Windows Service while workflow instance(s) are running, what is the best way to manage this scenario.   Our inclination is to persist these workflows (using sql persistence) and then on the next start of the Windows Service, resume these workflow instances and allow them to continue to completion.    In OnStart, we have a handle to the Workflow Service host.    How can we iterate through all the active workflow instances in OnStop and then in OnStart, resume these after the workflow service host is opened and running?   Are there are any methods of managing this scenario?    Thanks

Windows FTP script mget




I want to download a folder from a remote server using Windows FTP scripts.

I try this.

>ftp -s:er.txt





cd usr/local/

mget testdir



It doesn't work. I get:



230 User root logged in.

ftp> cd usr/local/

250 CWD command successful.

ftp> mget testdir

200 Type set to A; form set to N.

mget testdir/New Microsoft Word Document.docx? quit




How to do it?


Schedule a task with windows scheduler and vb script.



I need to schedule a task in my system with windows task scheduler and vbscript(or js also). 

I want to send an http request for an aspx page in my project fom the vbscript file .This aspx page contains some database related operations.

That means when the task scheduler is started it should update my project db.


I got this link for reference


But it is not working for me.

Can anybody pls help me to accomplish this task? Can i use javascript instead of vb script?

My project is in C# and backend is sql server express 2008

Thanks, in advance




WCF hosted in a Windows Service, how to make calls to the WCF service from within the service host


I have a Windows service that I converted to a WCF service that I want to host in a Windows Service.  I need to do some specific tasks in the OnStart() and OnStop() just like I did when it was just a Windows service.  My original Windows service OnStart() is where I create the main worker thread.  So how do I make a call into my WCF service from within the hosting service? For example in the hosting service's OnStart() I do a host.Open() then I need to call a method in my WCF service but how?



ServiceHost host =

EXPERT: Method error 500 in dropdown (solution is NOT adding System.Web.Script.Services.ScriptServic


Please only answer if you have read the full question!!

Ok...this thing is driving me crazy!!!!

I keep getting a method error 500 in my dropdown box.

All the posts on the web come with the same solution, but it doesnt work for me!
The code seems SO simple and consists of so few lines....but it just doesnt work!



<asp:DropDownList ID="ddlCountries" runat="server">

<cc1:cascadingdropdown ID="cddCountries" runat="server" Category="Country" Enabled="True" LoadingText="Loading...please wait." PromptText="Choose a country" ServiceMethod="GetCountries" ServicePath="geolocation.asmx"     TargetControlID="ddlCountries"></cc1:cascadingdropdown>

<%@ WebService Language="VB" CodeBehind="~/App_Code/geolocation.vb" %>

<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
 Public Class geoloc

Cannot host WCF in Windows Server 2008 R2


I have develop a WCF service using Visual Studio 2008 and windows 7.  Now when i have deployed the WCF oin a Windows Server 2008 R2, i got hthis error:

Field not found: 'System.ServiceModel.Activation.HostedServiceTransportSettings.IisExtendedProtectionPolicy'.


I have try numerous solution but in vain... can you please help in in solving this problem




Heveen Sharma KEJIOU Software Engineer

prbolems using HTML dropdown in asp.net


i have  2 html dropdown(SELECT ) controls
one is having month other day
this values are stored in databse
i hve a javascript function for populating the day drop with the nos of days depending on month selected


1)monthdropdown.value gives blank when storing the month in database
2)when i retrive the stored date suppose 2010-08-06 usingmonthdropdown.selectedindex= DatePart(DateInterval.Month, READER("DATE"))
i get 08 ie aug when debugging but in dropdown the previous month is displayed july

3) 06 get stored in date databse but when retriving  i get teh day dropdown blank

html dropdown list


i am using a html drop down list ie <select id=month runat=server...><option value="01">JAN</option>........................


i store the selected month in databse & when retriving back i use

month.selectedindex=DatePart(DateInterval.Month, '2010-02-05')

when i debug DatePart(DateInterval.Month, '2010-02-05') i get the value as 2

but in dropdown it gives index as 1 and Jan is selected if i store any other month eg NOV ie 11

when i retrive back i get OCT

how do i get the correct value selected



Set dropdown width of a textbox with AutoComplete in windows forms



I have used a Textbox control along with its AutoComplete feature by using AutoCompleteMode,AutoCompleteSource and AutoCompleteCustomSource properties.

Everything is working fine i.e. on typing letters dropdown list shows the related matching list of values.

However, I am not able to set the size of dropdown list programmatically.  I can increase the size(preferably width) of dropdown list at runtime.  But, as AutoCompleteCustomSource is getting reset everytime the textbox gets focused, dropdown list width also gets reset to the width of the textbox.

Just like the feature of Combo to set DropDownWidth programmatically (or say at design time), is there any way to set dropdown width for a Textbox having AutoComplete feature.

My Code for the reference (On Form Load event) :

        TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest

Firefox not displaying DropDown Menus?!?


Hello master ASP.net programmers. Here is a stumper for ya.

I have a masterpage that contains all my dropdown menu controls. The 2 largest browser hits on my site are IE and Firefox (in that order). I just recently updated to the latest version of Firefox and now... my dropdown menus no longer appear with Firefox but still do with IE.

There is nothing strange going on with my masterpage and it used to work fine in both IE and Firefox. Not too sure what is going on and can't seem to find anyone else who has posted on this subject.

I can post code if that will help. If you want to take a look at my website in your browser here it is: www.dialogcoach.com

I welcome any and all feedback.



Control Ubuntu iptables from Windows host


Hello. I am writing an application, that will control the routing on ubuntu iptables firewall. I need a reliable way to execute commands on linux machine, but instantiate these commands from my .net code on Windows machine. Which mechanism can you advise? Or should I write a second mono app, that my main app will comunicate with, and the mono app will issue commands locally?

Thank you in advance for a tip.

Max Pavlov http://maxpavlov.com
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend