|
I have a application on client that will connect to server so i want to get Time on Server from Client. How to do that.
|
|
|
|
|
hi,
If the database in the server ,You can simply run a SQL query and get time on that server computer.
"SELECT getdate() as serverdatetime"
If you run above query after connecting to database in the server,then You will receive the Time on the server.
regards,
pubudu.
|
|
|
|
|
That depends entirely on your server. What are you connecting to? A file share?, TCP port?, a server application that your wrote?, NTP service?, Web Service?, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I'm new with c# and i have a question for you :
it's possible to define a module in c# like in vb.net?
I need to define some utility function accessible by any page of my web application; do i need a class for this? and create an instance of that class everytime i need to call someone of the utility function?
There's some other way?
thanks
|
|
|
|
|
LIUCKAS wrote:
do i need a class for this?
Yes.
LIUCKAS wrote:
and create an instance of that class everytime i need to call someone of the utility function?
Only if you want to. You can create a class with just static methods in it - that means that you don't need to create an instance of the class in order to run the static method.
LIUCKAS wrote:
There's some other way?
There are lots of ways. For example: You could also create a singleton class - that is a class with a private constructor and it manages its on creation so that there will only ever be one instance of the class in existance in the application.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
|
hi friends,please help me. i have written code for into mdi form for openning a child form.
private void menuItem7_Click(object sender, System.EventArgs e)
{
frmBaseForm frmLoad= new frmBaseForm();
frmLoad.MdiParent =this;
frmLoad.Left =0;
frmLoad.Top =0;
frmLoad.Show();
}
when i click menu more then once,this code open more then one form.
i don't want that. it can be solve by using variable and may be enabling disabling the menu item. but i want optimum solution
thnx a lot
|
|
|
|
|
Use this function...if it suits you...
frmBaseForm frmLoad= new frmBaseForm();
ShowMdiChild(frmLaod);
private void ShowMdiChild(Form frm)
{
if(frm==null)
return;
for(int i = 0 ; i < this.MdiChildren.GetLength(0) ; i++ )
if(this.MdiChildren[i].Name.Equals(frm.Name))
return;
//if (! this.Contains(frm))
frm.MdiParent = this;
frm.Show();
}
sorry for my bad English.
|
|
|
|
|
thnx a lot,its working fine
|
|
|
|
|
Hello,
Im' using i'm called matlab using dll ; it's clear how pass a double variables, but i can't pass a string variables, Plz how we can do it ?
|
|
|
|
|
How can i do to write an function which can:
-Trim spaces in the first, last of string and return an space in case of there are too many spaces between letters
-Upper case the first character of string an each letter of string the remain letter is lower case
for example when user input:
aBcd efG hiK
The return string is:
Abcd Efg Hik
Please help me talents.
Thanks and best regards.
I tried so hard and got so far
|
|
|
|
|
Look for the Trim function in the string class, that should help you achieve your first objective.
For the second, you can traverse the string till you hit a non space character, change that character to upper case, then change the next ocurring characters to lower case until you hit a space (or reach the end of the string). You need to use System.Text.StringBuilder for this, as the string class doesn't allow the string to be modified.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi, is it possible to configure HTML formatted message with Log4Net's SMTP appender?
Thanks.
Norman Fung
|
|
|
|
|
I have a sample class as shown below
public class MyAirport
{
delegate void ProcessAirport(string s);
ProcessAirport pa;
public MyAirport(string sAirportName)
{
pa = new ProcessAirport(ProcessMumbai);
}
private void ProcessMumbai(string s)
{
MessageBox.Show(s);
}
public void ProcessAirport()
{
pa("Hello Mumbai");
}
}
in the class above i have used created a delegate instance with statement
pa = new ProcessAirport(ProcessMumbai);
where in i am passing 'ProcessMumbai' directly as a function pointer to ProcessAirport delegate.
now my question is : can i pass function pointer referance by string like,
pa = new ProcessAirport("ProcessMumbai");
if so, please guide.
thanks,
vaibhav
|
|
|
|
|
AFAIK, you can't do that directly with delegates. You need to use reflection for that. Something like
public class MyAirport
{
delegate void ProcessAirportDelegate(MethodInfo methodInfo);
ProcessAirportDelegate pa;
public MyAirport(string airportName)
{
pa = new ProcessAirportDelegate(ProcessAirport);
}
private void ProcessAirport(MethodInfo methodInfo)
{
methodInfo.Invoke(this, new object[] {});
}
public void CallProcessMethod(string methodName)
{
MethodInfo methodInfo = this.GetType().GetMethod(methodName);
pa(methodInfo);
}
}
I created a delegate because your code had one. You can instead call methodInfo.Invoke directly from CallProcessMethod .
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi Senthil,
Thanks for the help. Now i have got the perfect clue. now i am not using gelegates, i am using reflection instade.
thanks,
vaibhav.
|
|
|
|
|
do u know the link of download directshow sdk?
shumyla
|
|
|
|
|
If you can't find it, you probably should not bother downloading it. The DX SDK requires more problem solving ability than typing "direct x download" into google.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi everyone
Does anybody have a rather simple code that teaches how to write a docking ToolBar in an MDI application? Please give it me. I will be very appreciated it.
Nguyen Thai Binh
|
|
|
|
|
|
1.How to get Audio & Video Stream data using Directshow?
2.How to send,replay this data on network?
shumyla
|
|
|
|
|
Okay...I've been searching for something easy in regard to the subject line but haven't found it (still looking though). In the meantime does anyone have an easy way to get a file explorer to work in a treeview? And to to make the files clickable?
Thanks!
And I must comment that I just found this web page about 2 days ago. Already it's my #1 Code page to go to. This page is great! Keep it up!!
|
|
|
|
|
|
I d/l'd that and looked it over. It's not bad but it's not what I'm looking for. The way this one is working is the files are being displayed in a different view. Why they did this I don't understand but it's functional. What I'm looking for is something that works like Windows Explorer but in a treeview box.
Thanks for the suggestion. I'm going to continue to tweak what is in that advanced file explorer...who knows, I may get it to run the way I want it too.
|
|
|
|
|
I want to intercet the ondraw event of textbox to avoid to draw the classic base with a trasparent one.
How could i do?
|
|
|
|