|
mghiassi wrote: C# does not know DataSet and not show method and properties
So you should go back to your beginners books and tutorials until you understand how to add new files and classes to a project before you start messing around with DataSets.
led mike
|
|
|
|
|
Perhaps you should first ask yourself "why" to use a DataSet in your application.
|
|
|
|
|
|
It depends on the application that have created your dat file.
Is-it your own application ? did you use serialization ?
...
|
|
|
|
|
Hi all I need to get the source ip from a udp header I read udp data in the following way.
byte[] data = null;
IPEndPoint ipep = new IPEndPoint(IPAddress.Any, port);
Socket newsock = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
newsock.Bind(ipep);
IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
EndPoint tmpRemote = (EndPoint)(sender);
DateTime file_time = DateTime.Now;
int file_counter = 0;
while(true)
{
int counter = 0;
data = new byte[2048];
Console.WriteLine();
Console.WriteLine("Waiting for a client...");
recv = newsock.ReceiveFrom(data, ref tmpRemote);
Does anybody know how to do this
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Stephen Lintott wrote: Hi all I need to get the source ip from a udp header I read udp data in the following way.
Stephen Lintott wrote: recv = newsock.ReceiveFrom(data, ref tmpRemote);
I believe the source ip is staring you in the face (if not, hint: look at tmpRemote after the call).
|
|
|
|
|
First I thought that that was it but running the program I get our Gateway address instead of the router address. Why is this?
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
That sounds normal if the packet originated outside the local network. It is the normal behaviour of NAT I believe. If you are doing multicast, it wont even go beyond the local network, that's how UDP multicast work.
|
|
|
|
|
Thanks I was unsure about this.
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Hi All,
There is 2 comboboxes named "cmbMinNoSem", "cmbMinNoSem" and an Xml (that fetches the values from database). I want to get selected the combobox value that is in the xml. I have written the code as below:
cmbMinNoofSem.SelectedValue = xmlDom.GetElementsByTagName("min_no_of_semesters")[0].InnerText;
cmbMaxNoofSem.SelectedValue = xmlDom.GetElementsByTagName("max_no_of_semesters")[0].InnerText;
The first statement works fine but the second one does'nt
Thanks in advance.
Regards,
chanzeb chaudhary
|
|
|
|
|
Anyone know how you can get the current refresh rate of one (or more) monitors attatched to a computer? I can't seem to find it.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Start with the Win32 API GetDeviceCaps(), look for VREFRESH.
That's how we did it in the old days, anyway. This model may have changed with XP and Vista.
I would start by googling GetDeviceCaps, at any rate.
|
|
|
|
|
|
A more modern way would be to use WMI to get the device capabilities of attached hardware.
There, I've given you three starting points . Sorry I don't have code on hand for this.
Your new favorite word is "imbroglio".
|
|
|
|
|
|
Thanks. Slow day is it?
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
is there a way to get all the root paths of all the drives? like c:\ d:\ e:\ f:\ and so on..
|
|
|
|
|
WMI may help, but i dont know excatly how to do it. and there is probably a faster way, one of the guys here was using it to get the space used and space available on each drive on a system and remote server and it was kinda slow.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
string[] drives = Environment.GetLogicalDrives();
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hello
Yes !
you can use WMI to get all connected drives
|
|
|
|
|
Of course you can ... alot of ways to do so and WMI is one of them ... use the System.Management namespace to help you so ... as follows:
ArrayList list = new ArrayList();
using (ManagementObjectSearcher DiskSearch = new ManagementObjectSearcher(new SelectQuery("Select * from Win32_LogicalDisk")))
{
using (ManagementObjectCollection moDiskCollection = DiskSearch.Get())
{
foreach (ManagementObject mo in moDiskCollection)
{
list.Add(mo["Name"].ToString ());
MessageBox.Show(mo["Name"].ToString());
mo.Dispose();
}
}
}
Dont forget to add a reference in your project to System.Management dll and you will get all the drives .. for more properties go to this link to get them (other than the Name property used here):
http://msdn.microsoft.com/en-us/library/aa394173.aspx[^]
Enjoy !
Note: If you found this answer useful please indicate that so other would know so.
Sincerely Samer Abu Rabie
Software Engineer
|
|
|
|
|
All,
thanks to led mike I have a new project template in my 'create project' part of VS2005. Opening it opens my wizard dialog and after some options I can start creating my custom solution.
My code however crashes on the AddFromTemplate method.
(EnvDTE.Project proj = MySolution.AddFromTemplate( ... ); )
it gives a HRESULT failed from the com interop error. I check my path and the example of MSDN and it looks OK.
My guess is that the project template I use is not really valid (exact copy of the standard windowsapplication project)
Can anyone help me with this?
MSDN[^] doesn't seem to explain what exactly you need to do...
thanks a lot (nearly there , maybe I can write an article about it in exchenge if I get it to work )
|
|
|
|
|
I have a string and I want to compare to another string, and if they are not equal I want my app to do something. How is the not equal statement in C#? Like for equal we have: if(string.Equals(anotherString)) do something. How should I declare if is not equal? Thx
|
|
|
|
|
|