• Home
  • VB.NET/ASP.NET
  • Java
  • Linux
  • Windows
  • SQL Server
  • About us
  • Contact Us
  • Privacy

How to get command line arguments in VB.NET

postdateiconSaturday, 14 May 2011 14:18
The key thing about command line arguments is to define the "Main" function correctly - that then allows access to the command line arguments via the array arg.

for example this method will output the entered arguments to the screen

Shared Sub Main(ByVal args As String())
    For Each arg As String In args
        Console.WriteLine(arg)
    Next arg 
End Sub

Why in UserControls the tags aren't working

postdateiconSunday, 01 November 2009 19:51
This problem catches me everytime - I create a user control

<foot:footer id="Foot1" runat="server" />

and I add a new property called prop which I want to assign a value using server tags

<foot:footer id="Foot1" runat="server" prop="<%= GetTheProperty() %>" />

which just doesn't work.

The reason that it isn't working is that its a server based control and is entirely setup serverside, so to get it working you
need to add an additional DataBind in the page_load sub and to user the late binding version of the server tags (<%#)

i.e.

<foot:footer id="Foot1" runat="server" prop="<%# GetTheProperty() %>" />
Page.Form.FindControl("Foot1").DataBind()

would do it for the above example


Creating files with dates and times in batch jobs

postdateiconFriday, 11 June 2010 13:02
The article at the link below describes how to use the for loop with the date command to create files / directories with a date and time.

An example script looks like this :-

rem create directory based on current month
for /f "tokens=1-4 delims=/ " %%d in ("%date%") do set DIRNAME=Archive%%e-%%f
echo %DIRNAME%
mkdir %DIRNAME%

You can find more information in this excellent article at Computer Hope http://www.computerhope.com/issues/ch000987.htm

Copyright 2009 - 2011 Graham Robinson Software

 

Designed by Graham Robinson Software.