
August 24th, 2005, 04:16 AM
|
|
Registered User
|
|
Join Date: Aug 2005
Posts: 1
Time spent in forums: 17 m 22 sec
Reputation Power: 0
|
|
|
[C#] using args
Code:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Xml;
using System.IO;
using WindowsApplication1.nu.realtime.webservices;
namespace WindowsApplication1
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private AuthHeader Credentials = new AuthHeader();
private Historical History = new Historical();
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.TextBox textBox5;
private XmlNode Result;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
// code from VS.NET
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.Run(new Form1());
string ID = args[0];
string StartTime = args[1];
string EndTime = args[2];
string Flags = args[3];
}
private void button1_Click(object sender, System.EventArgs e)
{
Credentials.Community = "RealTime\\Vermeer";
Credentials.UserIdentity = "Realtime\\Vermeer";
Credentials.Password = "******";
History.AuthHeaderValue = Credentials;
Result = History.VehicleHistory(4248, "2005-05-01 00:00:00", "2005-05-2 23:00:00", 1);
textBox1.Text = Result.InnerXml.Replace(">",">/r/n");
// De waardes die ik heb in de textbox weg gaan schrijven in een outputfile.
StreamWriter fi = new StreamWriter("C:\\Outputfile.txt");
fi.Write(textBox1.Text);
fi.Close();
Close();
}
}
}
Hello this is my first time here...
I am supposed to make a simple program which is used by another (C++) program for getting data of the internet. Well the date is going well but now I need to use the program without seing it. Thats why I want to use args for starting the program and let the program do his thing.
Here are my questions:
1) How can I use the args as they are. I need them to get the right data of the internet.
2) How can I let the program use the code from Button1_click without clicking on the button with my mouse.
Tnx in advance.
|