|
There isn't one. DNS will get set back to DHCP if you enable DHCP on the IP address. You can't have DHCP DNS without a DHCP enabled IP pickup.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
hi dave,
so that means, if i call EnableDHCP all entries in my dns list will be deleted and it becomes "automatic"? hm, but that's not happening somehow. i can not get rid of any static dns settings.
any ideas?
criss
|
|
|
|
|
i found the solution... before calling EnableDHCP, i have to clear my DNS list by assigning an empty array to SetDNSServerSearchOrder like
...
newdns["DNSServerSearchOrder"] = new string[] { };
mo.InvokeMethod("SetDNSServerSearchOrder", newdns, null);
mo.InvokeMethod("EnableDHCP", null, null);
...
where "mo" is the ManagementObject of my networkcard.
regards,
criss
|
|
|
|
|
Hi,
I have a couple of questions in c# desctop Applics,
1)how can i respond to hitting the enter key on a combobox, to take the value entered from the user as if it's a text box?
2)how to allign the text in a rich text box to be centered??
ur help is appreciated, Thanks
|
|
|
|
|
r_jaz wrote: how can i respond to hitting the enter key on a combobox, to take the value entered from the user as if it's a text box?
Override the OnKeyPress event.
|
|
|
|
|
Check the OnkeyPress event for the first question.
regarding the second one,
right click the RTB. There is a property called TextAlign. Choose accordingly.
Keshav Kamat
India
|
|
|
|
|
Hi,
Thanks all for reply,
there's no TextAlign property for richtextboxes its for textboxes only, i used the property of SelectionAligment by SelectAll() and then DeSelectAll()
to centralize it but i wanted to see if there's a direct proprty such as TextAlign to do the job..
Thanks
|
|
|
|
|
Hi All,
I'm taking a shot at writing my own add-in. Right now I'm working on getting it to open designers for my projects forms.
I can open a designer if I know the forms file path ahead of time. How do I tell the DTE to open the designer for a specified form by it's class name? I know the form class name is frmTest, however it's file name may be something other than frmTest.cs.
Or, is there a way for me to ask the dte to give me the file that contains the definition for a specified class name?
Thanks,
|
|
|
|
|
Situation:
- GUI Application
- Windows Service
Both each have a project inside the Visual Studio solution. So during the debugging process, the each look into their own bin\Debug directory.
Both need to use the same database (dbname.mdb).
We would like to place the mdb file in the application folder. The installation should take care of that (which it already does).
How can we reach the database without having to hardcode the URI to the mdb file? During the install users can choose what the application folder should be.
Thanks in advance
|
|
|
|
|
Try System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Stealing my signature! :P
Bryan Ray
http://bryanray.net
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
|
|
|
|
|
System.AppDomain.CurrentDomain.BaseDirectory returns the current application start folder. It migth do the trick, I use it and it works.
|
|
|
|
|
The first option given does not work. It looks in the application folder for the GUI application. The service however will look in the system32 folder.
MSilviu seemed to have the right anwser. I tested it out and it worked. So thanks for the input.
|
|
|
|
|
Hello.
So these are my problems:
I have to find a way to save a class of mine to a file.
I found serialization and I thought it might work.
But... When I tried BinarySerialization, some chars would just disapear, and I'd get an exception for "not a correct format".
XmlSerialization is throwing non-stopable exceptions, I just went to the one after.
I tried SOAP serialization, but now I came across another problem.
I need to serialize a generic collection which I built. This gives me an exception, saying that it cannot serialize a generic class. (that's after successfuly serializing List<t>).
Another thing that I have with SOAP serialization is that i'm not sure that it'll work in Linux (I was unable to install mono), since I need to import the SOAP class from Windows folder.
Can anyone recommend me on what to do?
Waiting for your help.
NaNg.
|
|
|
|
|
I don’t really understand what the problem is you are experiencing but I could tell you how I serialize into a binary stream I stream can be send or saved to file. Serializing to XML goes the same way. Note both serializer and deserializer and the object definition of the object to serialize should be the same at the sending and receiving end. To ensure this I simply put the classes in a dll which both sides use. With dotnet 1.x the formatter will give an exception when a version difference is detected. In dotnet 2.0 the formatter will serialize everything it recognizes even if there are version differences. The class to serialize should be declared with [Serializable]
///
/// Serialize object to byte array, object must be Serializable
///
/// <param name="someobject" />object to serialize
/// <returns>array
public byte[] Serialize(T someobject)
{
byte[] objectstream=null;
BinaryFormatter f = new BinaryFormatter();
MemoryStream stream = new MemoryStream();
f.Serialize(stream, someobject);
stream.SetLength( stream.Position);
objectstream = stream.GetBuffer();
return objectstream;
}
public void Deserialize(byte[] stream, out T someobject)
{
BinaryFormatter f = new BinaryFormatter();
MemoryStream serstream = new MemoryStream(stream);
someobject = (T)f.Deserialize(serstream);
}
Class def of class to serialize:
[Serializable]
public class SetConfigMessage
{
public string Name = "";
public string Value = "";
///
/// Config message
///
/// <param name="name" />
/// <param name="svalue" />
public SetConfigMessage() { }
public SetConfigMessage(string name, string value)
{
this.Name = name;
this.Value = value;
}
}
madv113
|
|
|
|
|
My problem is that I can't serialize with binary formatter (even like you did, I can't), and SOAP doesn't let me serialize generic classes that I've made.
I don't get what's hard to understand, I wrote it perfectly clear in the first message.
|
|
|
|
|
hi
i am using remoting..
on the remote system wwwroot i have a dll (FXP) which returns several strings(For different varaites of functions)....
now from the client i am getting reply for few functions and for another function i am getting server encountered internal error....
i want to knwo how can i debug and solve the problem...
as far as i know i dont have any security problems i have given all the rights.. to the folders and files which i access,,,,
thanks in advance
bye
|
|
|
|
|
This is just a shot in the dark, but if you have both static methods and instance methods, I would guess the static methods work and the instance don't. I would suggest all the methods be static. Which means you don't have to create an object to use them.
Hope that helps.
Ben
|
|
|
|
|
thanks for the idea ...
i will give try and let u knwo about it..
thanks dude
bye takecare
|
|
|
|
|
does calling a member function on a struct invlove boxing?
(Sorry for the simple question, I got all my books at work...)
|
|
|
|
|
I'm not sure I follow. I don't think so, but perhaps I am not understanding the question ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
struct X
{
int x;
void Foo() { ... }
}
X x;
x.Foo();
Thinking about it, it would be patently silly, so I guess not. But they left default args out of the language, too
|
|
|
|
|
I expect not, no.
Yeah, I've been complaining about default variables for as long as I've been an MVP, who knows, they may one day listen.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: I've been complaining about default variables
shameless plug[^]
|
|
|
|
|
Nope I don't think so as it comes under value types !!
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|