|
DateTime date1, date2
System.TimeSpan datediff
System.TimeSpan datediff = date1.subtract(date2)
Response.Write(datediff.TotalDays);
Nahed Kadih
www.arabiahotjobs.com
(Jobs in Middle East)
|
|
|
|
|
Can anyone give me a link to sources on the web or hints on how to write a program the will add and option to program window that minimize it to system tray? I want to do something simular to http://www.actualtools.com/windowmenu/ but only I only want to add a button to all application windows that will allow me to minimize it to system tray. For instance, if I startup Outlook it will automatically have this "minimize to system tray" added button it. If I run any application it will automatically have this "minimize to system tray" button added to it.
Thanks,
|
|
|
|
|
hi all,
Can anyone please suggest me the way to insert value into certain column in the DataGridView?Example, i want to insert a value "x" into the 1st column of the 3rd row in DataGridView.
Please guide me to solve it.
Thanks in advance;)
cocoonwls
|
|
|
|
|
cocoonwls wrote: Can anyone please suggest me the way to insert value into certain column in the DataGridView?Example, i want to insert a value "x" into the 1st column of the 3rd row in DataGridView.
dataGridView.Rows[2].Cells[0].Value = obj;
|
|
|
|
|
hi,
Thanks ya;)
have a nice day!!!
cocoonwls
|
|
|
|
|
I have been trying to create a setup project for an application. I am having trouble with one aspect however. I simply want the installer to execute another small program I wrote during installation. This other program applies some additional settings. I placed this executable under the custom actions tab in the "install" folder. I expect this to run once during installation, but I instead find that it runs every time I double-click on the newly installed applications shortcut. Why in the world would this custom action execute every time the new program is run? And where is the exe for this custom action being stored since its not in the installation directory?
Thanks.
|
|
|
|
|
Hello!
I have a problem with creating these arrays. The MAXNumberOfVectors and the MAXNumberOfVertices get the error to be used as a type name instead.
How do I do this, because this won't compile as it is, and I don't have a clue as to why this is... I am sure there must be a slightly different way to do this in C#. But that I couldn't find in my books how to do this.
Please some advice...
Thanks,
Ranger.
public class Storage
{
public int CenterX = 150;
public int CenterY = 150;
public int NumberOfVectors = 0;
public int NumberOfVertices = 0;
public const int MAXNumberOfVectors = 100; <-- compile time error
public const int MAXNumberOfVertices = 200; <-- compile time error
public Vector[] StoreVectors = new Vector[MAXNumberOfVectors];
public int[] StoreVerticesFrom = new int[MAXNumberOfVertices];
public int[] StoreVerticesTo = new int[MAXNumberOfVertices];
public Point2D[] StorePoints = new Point2D[MAXNumberOfVectors];
Beginner
|
|
|
|
|
Well, I looked around in articles on this site, and found a reference to a method that creates an instance for an array, where you can determine yourself what the size and type of this array is. So I tried the following way to get to declare an arry of a certain size.
Still I get the following error message and that I don't know what this message means.
Can anyone help me clear this last hurdle..?
Thanks,
Ranger....
Static member 'Aljo3D_1.Storage.MAXNumberOfVectors' cannot be accessed with an instance reference; qualify it with a type name instead
private const int MAXNumberOfVectors = 100;
private const int MAXNumberOfVertices = 200;
public Vector[] StoreVectors;
public int[] StoreVerticesFrom;
public int[] StoreVerticesTo;
public Point2D[] StorePoints;
public Storage()
{
Array StoreVectors = Array.CreateInstance(typeof(Vector), MAXNumberOfVectors);
Array StoreVerticesFrom = Array.CreateInstance(typeof(int), MAXNumberOfVertices);
Array StoreVerticesTo = Array.CreateInstance(typeof(int), MAXNumberOfVertices);
Array StorePoints = Array.CreateInstance(typeof(Point2D), MAXNumberOfVectors);
}
Beginner
|
|
|
|
|
This works... I removed the word 'const' from the MAXNumber variables and now it compiles without errors.
I knew it was something simple.
Ranger.
public int MAXNumberOfVectors = 100;
public int MAXNumberOfVertices = 200;
public Vector[] StoreVectors;
public int[] StoreVerticesFrom;
public int[] StoreVerticesTo;
public Point2D[] StorePoints;
public Storage()
{
Array StoreVectors = Array.CreateInstance(typeof(Vector), MAXNumberOfVectors);
Array StoreVerticesFrom = Array.CreateInstance(typeof(int), MAXNumberOfVertices);
Array StoreVerticesTo = Array.CreateInstance(typeof(int), MAXNumberOfVertices);
Array StorePoints = Array.CreateInstance(typeof(Point2D), MAXNumberOfVectors);
}
Beginner
|
|
|
|
|
Use a List instead, unless you really want to have a maximum possible number.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
your code compiles just fine for me. This is what I have:
public class Storage {
public int CenterX = 150;
public int CenterY = 150;
public int NumberOfVectors = 0;
public int NumberOfVertices = 0;
public const int MAXNumberOfVectors = 100;
public const int MAXNumberOfVertices = 200;
public int[] StoreVerticesFrom = new int[MAXNumberOfVertices];
public int[] StoreVerticesTo = new int[MAXNumberOfVertices];
}
So I dont know what went wrong for you. Also I suggest you mention the exact
compiler message (instead of "wont compile" or "does not work" or so).
And there is nothing wrong in using the const keyword to indicate something will
never allow to be modified, it is considered good practice.
BTW I concur with Christian's remark to use some (unlimited) collection instead;
you seldom need to impose a maximum (you might want to do that when memory becomes
tight and can be better spent, or when simulating a fixed size cache, or so).
Luc Pattyn
|
|
|
|
|
Luc Pattyn wrote: your code compiles just fine for me.
Well, I got an error message which disappeared after some trial and error changes to my code.
Luc Pattyn wrote: I concur with Christian's remark to use some (unlimited) collection instead;
I read about that in a book about C# I bought, but I am a novice, so I plan not to bite off more than I can chew, because I found that <list> matter kind of complicated.
As it is I am amazed about what you can do with Microsoft Visual C# 2005 Express Edition.
With programming practice, I am getting more understanding of how to use classes to keep things relatively easy to understand as you program gets to be able to do more and more.
I am having a ball with Express Edition.
Thanks for your comment.
Ranger.
Beginner
|
|
|
|
|
Even though i searched in google,i could n't get good link for .net remoting debugging. I have a windows application and my .Net remoting component is hosted in IIS. If any of you has good link for .net remoting debugging, could you please send me.
Thanks,
Suresh.P.S
|
|
|
|
|
Hi guys,
We have users in our company running one of the applications that I developed and unfortunately at the moment any code change I make, I am having to reinstall the whole application. Is there a way to create an update project that will search a particular dll and update it with the new dll without having to reinstall the whole app.
Please help!!!!!
sasa
|
|
|
|
|
If you're using .NET 2 take a look at the ClickOnce[^] technology
|
|
|
|
|
unfortunately I use 1.1
sasa
|
|
|
|
|
There is a Microsoft Application Update block I think which might work under .NET 1.1, alternatively there are a couple of articles
here on CP which deal with the issue. Basically what you have to do is write a small program which checks for the update from a url or something (looks at an xml file for example to see if the dll versions have changed) and then download these. If there are no updates or there were you then run the program regardless, exactly like a bootstrapper.
|
|
|
|
|
Thanks Ed
I appreciate your help. I don't know how to do your suggestion but I will look into it further. Thank God to the Internet.
sasa
|
|
|
|
|
Hello,
I need to read ip adress from all users how click on my site.
I have a code like this : String strHostName = Dns.GetHostName();
Console.WriteLine("Host Name: " + strHostName);
IPHostEntry iphostentry = Dns.GetHostByName(strHostName);
int nIP = 0;
foreach(IPAddress ipaddress in iphostentry.AddressList)
{
//lbldns.Text = "IP #" + ++nIP + ": " + ipaddress.ToString();
}
but my code read ip adress from host and i need ip adress from clients.
Also i have few labels how read name of computer and OS also from server and also i need this thinks from users:
here is my labels: lblhostname.Text = System.Environment.MachineName;
lblOS.Text = Convert.ToString(System.Environment.OSVersion);
Thanks for helping me
|
|
|
|
|
You can use Request.UserHostAddress()
More Info on Tracking Clients can be found here[^]
|
|
|
|
|
Hi, am doing my final year degree in Computer Science.
As part of my degree i need to do a project.... and so am planning to develope a firewall for windows xp sp2 in visual studion express 2005.
if anyone got any information about how i can do it, please help me.
Also tell me which tool from the visual studio should i use.
Am so much confused.... Please help me
Amal Hashim
|
|
|
|
|
If you want to implement anything resembling a complete Firewall you need to look at the Packet Filtering API from Microsoft. Be warned though that this is not an easy API to work with, especially from managed code.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi
I want to capture audio in my program and transfer it through the internet to the same program that will play the sound.
Is there a component in the .net that I can use for that. Or I have to use Windows API?
Can I use the DirectShow lib 1.5 for that and get all the functionality that I'll need?
Is there an article or a code example on that.
thanks in advance
|
|
|
|
|
Search for DShowNET that might do what you want, basically a port of DirectShow to .NET.
|
|
|
|
|