|
Hi,
I hope you can manipulate the follwing code and get information about the Domains
using System;
using System.Net;
class GetResolveInfo
{
public static void Main(string[] argv)
{
if (argv.Length != 1)
{
Console.WriteLine("Usage: GetResolveInfo address");
return;
}
IPHostEntry iphe = Dns.Resolve(argv[0]);
Console.WriteLine("Information for {0}", argv[0]);
Console.WriteLine("Host name: {0}", iphe.HostName);
foreach(string alias in iphe.Aliases)
{
Console.WriteLine("Alias: {0}", alias);
}
foreach(IPAddress address in iphe.AddressList)
{
Console.WriteLine("Address: {0}",
address.ToString());
}
}
}
Hope this will help you
kss
|
|
|
|
|
thanks for the reply..But here i have to give the domain name externally.what i need is my program has to find all the domains in the lan.thanks in adv
|
|
|
|
|
hi,
I am working on VS 2003.I have developed an window application.
I want to know how the application can be run in
1.GUI Mode
2.CommandLine Mode -In which the application should prompt
for the input from the user.
Thanks and Regards
vinutha kempanna
|
|
|
|
|
On the class where your start up form is there is a static method called Main() . It kicks off the GUI. You need to make a descision here whether to launch the GUI or go command line. The parameters passed into the Main method are the command line parameters. If there are none then you can launch the GUI. If there are parameters then you could process them and exit.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
I'm trying to return an Ampersand as a char using this code:
<br />
case 17:<br />
return '&';<br />
However, it doesn't return anything. So I tried using the unicode escape: \u0026. That didn't return anything either.
I've changed the fonts multiple times, but for some reason the ampersand just doesn't show up. Does anyone have a solution?
|
|
|
|
|
Paradox22 wrote: it doesn't return anything.
- What is "it" in the above phrase?
- What happens when you set a breakpoint at the return statement? Is it ever reached?
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
hi
u try
{
case 17:
return '\&';
}
|
|
|
|
|
Yes, of course it's returning something. A function always returns something, and there is no reason what so ever that it couldn't return a specific character.
The problem is where you handle what the function returns.
---
b { font-weight: normal; }
|
|
|
|
|
If you're displaying this value in UI, then due to mnenonic nature of the Windows forms, the "&" will get converted into an underline for the next character. You must return "&&" for it to be displayed on labels/captions/radio-buttons/menu-text etc.
- Malhar
|
|
|
|
|
Thank you!
That was the problem. The mnenonics was screwing it up.
|
|
|
|
|
Hello all,
I have this question of which I'm not able to find any solution on the internet. So I thougt that I could find one here.
I have a device hooked up to the serial port which provides the ability to connect analog potmeters to it. Now I'm able to get these ADC values and I want to pass these to windows OS to handle them further. The intention is that a game will see this as a joystick and can use the analog potmeters as joystick axis. I've done some reading about writing a device driver, but how do I make windows see my device as a joystick? Any help is much appreciated. I'm working mainly with C#.
Danny
|
|
|
|
|
|
Well, it is not the serial part that forms any difficulties. But I have this value of a Potmeter, which I aquired through a serial device, that I want to use as a joystick axis in games. So I want to pass this value to windowsXP so that it treats this as a joystick-axis. In other words, how do I simulate a joystick is connected which I can pass this value to in windows. I hope this is more clear what I mean.
Danny
|
|
|
|
|
Ah. Once you've acquired the coordinates from the pot, set the Cursor.Position property to move the cursor.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I do not want to control the mouse-cursor via a joystick, but I want joystick input like normal when a joystick is attached to the gameport. Now I have potmeters via a serial device which I want to use as the axis. How do I make windows see my joystick axis so I can use them in a game that supports DirectInput for joystick input.
Danny
|
|
|
|
|
Hi,
Is there any way to programmatically open the Shell file/folder properties dialog for a given file? Is it possible to open this dialog to a given tab?
Thanks,
DigitalKing
|
|
|
|
|
DigitalKing wrote: Is there any way to programmatically open the Shell file/folder properties dialog for a given file?
Yes.[^]
[edit]
Sorry - I was hasty in posting this note. See this[^] link instead. You'll need to convert the code to C#.
[/edit]
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Great! Thanks.
In case anyone else is interested, here's the code I came up with.
private const uint SW_SHOW = 5;
private const uint SEE_MASK_INVOKEIDLIST = 0xC;
private struct SHELLEXECUTEINFO
{
public int cbSize;
public uint fMask;
public IntPtr hwnd;
public string lpVerb;
public string lpFile;
public string lpParameters;
public string lpDirectory;
public uint nShow;
public uint hInstApp;
public string lpIDList;
public string lpClass;
public IntPtr hkeyClass;
public IntPtr dwHotKey;
public IntPtr hIcon;
public IntPtr hProcess;
}
[DllImport("shell32.dll")]
private static extern long ShellExecuteEx(ref SHELLEXECUTEINFO s);
public static void DisplayFileProperties(string path)
{
SHELLEXECUTEINFO shInfo = new SHELLEXECUTEINFO();
shInfo.lpFile = path;
shInfo.nShow = SW_SHOW;
shInfo.fMask = SEE_MASK_INVOKEIDLIST;
shInfo.lpVerb = "properties";
shInfo.cbSize = Marshal.SizeOf(shInfo);
ShellExecuteEx(ref shInfo);
}
|
|
|
|
|
hi
i want to change datagrid properties in form1 from other forms .. how to do this ???
i tested some waye (using public modifier for datagrid in form1 or using property to return datagrid properties or method that change datagrid properties from other forms but did't get result)
Please Help me how to this ???? (please give me a full details solution because i am beginner)
thanks ..
|
|
|
|
|
hi i want to save app setting in file and load it for next times ...
how to do this ???
(Please give me a full tutorial because i am beginner . thanks)
regards...
|
|
|
|
|
|
hi and thanks
the xml app setting is useful but only save string values . for example i want to save
datagrid1.AlternativeBackColor in app.config and retrieve it in form.load event . how to do this ?
thanks ...
|
|
|
|
|
hdv212 wrote: want to save datagrid1.AlternativeBackColor
AFAIK, the config file only stores strings. You could easily convert the color to a numeric value and store its string representation (name or RGB values) and do the reverse on the way out.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
How to convert a Color object to and from a string, for storing somewhere, has already been answered in your previous post regarding saving this value to the registry.
Please check there first. Once you understand this, the question of how to write it/read it to some form of configuration file is easy, and should be explained in the article linked above.
|
|
|
|
|
This just baffles me!
I know it is something simple and right under my nose but cant figure it out
static void Main(string[] args)
{
MessageBox.Show(args[0]);
}
How do i pass in arguments prior to running this program.
|
|
|
|