Click here to Skip to main content
15,900,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to dynamically generate an URL which should be of the following syntax:
<b>http://<variable  for domain>/FolderName/downloads.aspx?MAC=a.b.c.d & dtype=win</b>

Where I need to call this URL from a Windows service where in:
1.Read the value of <variable for domain>and MAC from some text file.

How to do dynamically generate such URL?

Thanks in advance.
Posted
Updated 4-Feb-11 0:59am
v2

1 solution

C#
String host = "www.somehost.com"; //In your case you'd take this from the file
String mac  = "MAC";
String url = String.Format("http://{0}/FolderName/downloads.aspx?MAC={1}&dtype=win", host, mac);
// Do something with your dynamically created url here
 
Share this answer
 
Comments
Espen Harlinn 4-Feb-11 11:38am    
Nice and simple answer, 5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900