|
In (server / client application )there is a webservice at the server side application, the clients access this webservice. the server can be located on any PC, so its IP
is dynamic. I do not have a fixed IP, for the server.
I have a problem in determining the IPAddress of the server everytime, in the web reference.
in other words, we want the address of the web reference to be dynamic, according to the current IP of the server.
Would anyone plz help me to do it !!!!
|
|
|
|
|
Yep, I'll quote MSDN because it puts it better than I ever could
You can use the Web Reference URL property to specify the URL to the XML Web service. The Add Web Reference sets this property by default to the URL of the XML Web service you select, which is a static URL. A Web reference can use either a static URL or a dynamic URL.
If you leave the URL Behavior set to the default value of static, the proxy class sets the URL property using a hard-coded URL when you create an instance of the class.
If you set the URL Behavior property of the Web reference to dynamic, the application obtains the URL at run time from the <appsettings> Element of your application's configuration file. When you specify a dynamic URL after adding a Web reference, Visual Studio updates the proxy class to obtain the URL from the configuration file.
<br />
<br />
<appSettings><br />
<add key="myApplication.myServer.Service1" <br />
value="http://myServer/myXmlWebService/Service1.asmx"/><br />
</appSettings><br />
When you create an instance of a proxy object, you can also set the URL property of the object in your application.
Hope that's some help to ya!!!
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Does anyone know if there's any function which returns the names of all the machine in the network?
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
That's a bit of a big ask unless the machines are on a domain administered by Active Directory Services!!
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Crap, it's administered on NT4 Can you just point to me to the right directions and I'll look from there.
Thanks a bunch
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
Erm... have a look at the DirectorySearcher and Directory Entry classes. They are mainly for Active Directory but I think WinNT which is a ADSI provider protocol (NT4) is supported so you might be able to use that... Otherwise it's Win32 API time... and at the moment I have no idea where to start...
Sorry!
I'll certainly give it some thought!!!
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Thanks..... will look into it!
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
No probs.. I'd be interested in knowing how you get on as I can't try the calls on a non-AD network... (AD city in this building!!)
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Hey,
I have a collection of objects. For each object in the collection I want to show a radiobutton on my windows.form.
ex.
O Object1.fieldname1
O Object2.fieldname1
O Object3.fieldname1
The problem is thatI have to create the radiobuttons dynamically, because I don't know how much objects are in my collection.
With a combobox there is no problem. I just use there a datasource, a displaymemeber and a valuemember.
But now, intead of having a combobox, I want it in radiobuttons.
I thought a radiobuttonlist was a solution, but that is only for webcontrols.
Or maybe I can play with the groupbox where the radiobuttons come in?
How I create a radiobutton at runtime??
Maybe somebody have an idea?
Thanks in advance,
Nic
|
|
|
|
|
I'd like to access files in remote computer.
However I hardly know how can I access..
What I want is,,
One client accesses to a server, and it checks some of files updated
(I think it is possible to identify modified date of file.)
And If some of file had changed, the client download the files from the server.
How can I do to make it? Thanks..
I'm not who I was
|
|
|
|
|
Not quite sure what it is you're trying to ultimately achieve but I would probably stick the file in a Web folder and then use the HttpRequest classes etc to get the file info and download the files.
It's certainly a better idea than just sharing a folder. Will it just be on a local network or reachable over the internet!?
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Is there event before a window form closed? Is it BeforeClosing ? But I can't find it in C#.How to realize it ?
X4ever
|
|
|
|
|
There's Closing, Close, QueryUnload, and Unload. Look 'em up!
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Xpelive,
The event you're looking for is Closing . The best way I have found to locate an event handler that is supported by an object is to select it in VS and look at the events list in the Properties pane... (press the lightning bolt button)... you can then select interesting looking ones and press F1 to get help on it!!!
HTH
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Take a look at this[^]article,that would give you better idea.
Cheers,
Kannan
|
|
|
|
|
Hi, Friends! Does C# have a string function like CString of C++ ? but the C#' String is too small or I must to inheritance String and write a new class ? thx!
|
|
|
|
|
Well there's the string class/type... which maps to System.String which has pretty much all of the functionality of the MFC CString.
The problem is that it is marked as sealed which means you can't derive a new class from it... you could contain a string object in another class then write your new methods to work with the contained string...
What is it you actually want to do?
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
thx! I want to know a word is the word's substring ot not, but System.String have not the function!
|
|
|
|
|
Can't you use IndexOfAny()???
e.g.
<br />
string myString = "Hello Dave, how are you today?";<br />
string searchString = "Dave";<br />
<br />
bool isSubstring = (myString.IndexOfAny(searchString)!= -1);<br />
<br />
if(isSubstring)...<br />
HTH
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
;P O ... ya.. thx! But, I always feel the String is too small , thank you very much !!
|
|
|
|
|
Anytime.
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Had a look at StringBuilder?
System.Text.StringBuilder
In C++, CString does the job of both System.String and System.Text.StringBuilder.
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
What size should I use to get an equivalent C struct for the type bool?
i.e.
struct
{
DWORD a;
bool b;
} s;
would be
struct s
{
int a;
// bool a; or char a; or byte a; ?
}
...what's the best way to marshal C bools?
|
|
|
|
|
grv575 wrote:
...what's the best way to marshal C bools?
bool is not a C data type. Look at the typedef of it.
<a TITLE="See my user info" href=http:
|
|
|
|
|
unsigned char or int?
What's more common (VC 6 i guess, if anyone can check)
|
|
|
|