473,385 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Passing Parameters to VB.NET Apps

Hi!

I have a small app with 2 forms. The first one requires users to login
and once they do the second one presents several combo boxes and text
boxes for them to select certain data. I need to schedule this
application to run several times a week without user intervention.

What would be the best way for me to accomplish this? How can I pass
the parameters I need?

Thank you!
Malosita
Jul 21 '05 #1
1 19679
Hi,

the best way to pass parameters is creating a tiny Main static method. I
think you can create it even in the form class. In the form source file,
enter the following:

Public Shared Sub Main(Params As String())

'Create the form instance
Dim loginForm As New Form1

'Fill the two textboxes with data from the command line
loginForm.txtUsername = Params(0)
loginForm.txtPassword = Params(1)

'Show the form and let the application run
loginForm.Show()
Application.Run(loginForm)

End Sub

I assumed the class for the login form is called "Form1" and that the two
textboxes are txtUsername and txtPassword. Also I assumed you passed name
and password as first and second parameters, like this: myapp.exe username
password

Remember to set your project (in project properties) to start from the
Form1.Main, instead of loading Form1 directly.

Hope this helps.
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures...
7
by: Pavils Jurjans | last post by:
Hallo, I have been programming for restricted environments where Internet Explorer is a standard, so I haven't stumbled upon this problem until now, when I need to write a DOM-compatible code. ...
1
by: Maria | last post by:
Hello! I am new to Crystal reports an I have problems passing parameters form outside to Crystal report an creating a report with data from more than one table This is the problem: I have to...
2
by: Carlos | last post by:
Hi all, I am familiar with passing parameters to a thread function using C++, but I needt to learn it using C#. Can someone shed some light on how to do this? Code snippets will be great to show...
2
by: Akira | last post by:
Hello. I'm having problem with passing parameters from .aspx file to user control. Could anyone tell me how to pass parameters from .aspx file to user control(.ascx) and how to recieve parameters...
0
by: Paul Allan | last post by:
I am new to ASP.net (intermediate ASP developer). I am developing a ASP.net web application and I am having some difficulty calling and passing parameters to a function that is declared in my...
4
by: Mike Dinnis | last post by:
Hi, I've been working through a number of turorials to try to learn more about retrieving data from a SQL database. I think i've mastered techniques where i create a sql string in the page and...
4
by: David Freeman | last post by:
Hi There! I'm just wondering if there's a way to pass parameters (as if you were passing parameters to a ASCX web control) when calling an ASPX page? e.g. MyDetailsPage.UserName = "david" ...
2
by: Nab | last post by:
I have just tried to pass parameters to a procedure in VB 2005 and realised that you only need to pass the input parameter. The output parameter's value will be returned without the need to pass it...
1
by: Gert Wurzer | last post by:
Hi! I have an asp.net 2.0 web application that uses an iframe to access another asp.bet 2.0 webapp via https. I've already found a working prototype solution to create a dynamic iframe taking...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.