|
ok then
i will try to find ip packets
and other details.......
|
|
|
|
|
Why do you need to create this rather than just finding an existing application that already does it?
|
|
|
|
|
ok, ok friends actually its not my requirement......
my project requirement to monitor lan card data that is passed through
lan card........
i know it's complicated. but now i have to know, related classes in c#
and size of project.
actually i already done to monitor shared folder using wmi classes but
it required refreshing again n again...
and also it is not able to monitor data that is communicate over internet.
if you know existing project then plz tell me.
thank you so much...
|
|
|
|
|
I can't really tell what you are asking there but I think you are suggesting that you don't actually need to implement it yourself.
So you can look for 'wireshark'.
There is also a many commercial apps, generally firewalls I believe, which can record IP traffic.
|
|
|
|
|
i'm new to TPL and , trying to achieve prioritization in tasks using TPL. which means for example , i have to start two tasks parallel (t1 and t2) but i need to give the priority to t1 means both are having messages to deliver but t1 got the highest priority messages so i need to send them before t2 messages. is this possible,
thanx in advance
|
|
|
|
|
About the only option you have is in the Task.CreationOptions property. The TaskCreationOptions enum can tell the scheduler to PreferFairness, meaning that tasks created earlier tend to run sooner than tasks created later.
Other than that, you'd have to setup some communication between tasks so they can work out whos going to send messages first.
But, if you have to schedule messages being sent, that sounds like a seperate thread that should maintain it's own message scheduler. Your other tasks would have to submit their messages (with a some priority token) to the scheduler to be sent out.
|
|
|
|
|
Hello,
I need to compare two decimals using the greater than sign. One of the decimals is a viewstate object and other decimal is from a textbox. I am doing the following
if (Convert.ToDecimal(ViewState["_first_min_wage"]) < (Convert.ToDecimal(txtSalary.Text)))
it is not going inside this block?
And I tried this as well
if ((Decimal.TryParse(strd1, out d1)) < Decimal.TryParse(txtSalary.Text, out d2)) -- did not work.
Thank you.
|
|
|
|
|
TryParse() returns a bool so I doubt that is what you want.
Have you checked what the "Convert.ToDecimal(ViewState["_first_min_wage"])" and "Convert.ToDecimal(txtSalary.Text)" calls return?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes. They return values like 7.55 and 8.55
|
|
|
|
|
TryParse will return a boolean... the values will be stored in d1 and d2. You can do something like this:
string strd1 = "5", strd2 = "6";
Decimal d1, d2;
if (Decimal.TryParse(strd1, out d1) && Decimal.TryParse(strd2, out d2))
{
if (d1 < d2)
{
}
}
However, if the value stored in the view state is not a string, you may only have to cast rather than parse:
Decimal startVal = 55;
ViewState["myVal"] = startVal;
Decimal val = (Decimal)ViewState["myVal"];
|
|
|
|
|
Perfect, that worked. Comparing them using d1 and d2
|
|
|
|
|
vanikanc wrote: using the greater than sign
vanikanc wrote: <
Try > instead.
|
|
|
|
|
'nuff said...
Will Rogers never met me.
|
|
|
|
|
I have an application that uses a net remoting server that that is on a public network that as no fixed ip address.
When the server changes the ip all the clientes steel connect to the old ip Address even if a call activator.GetObject
width the name of the server.
The service is running in siglecall Mode
and props["useIpAddress"] = false;.
TcpChannel
Can some one help me to solve this problem?
|
|
|
|
|
If your clients don't try an resolve the name with the DNS server that is maintaining your remote servers name/IP address, there's no way they are going to be able to connect.
You have two choices. Either move your server to a more "stable" static IP address or the clients will have to specifically be coded to resolve the IP of your server name with the DynmiacDNS of your servers hosting company.
|
|
|
|
|
Presumably you have already verified that the DHCP record is getting pushed as soon as the IP changes.
AND you have verified that a NEW client picks up the new IP address.
If either of the above is not true then the question has nothing to do with C#.
If both of the above is true then it might help to create a small bit of code that demonstrates exactly what you are doing. It might be your code or that a .Net API is 'helpfully' caching something it shouldn't.
|
|
|
|
|
Yes the ip of the server changes and i can ping the server using the new ip address.
the code i use is this:
string serverAddress = ServerAddress;
int LocalPort = localport;
IDictionary props = new Hashtable();
props["name"] = "DbSync";
props["timeout"] = 60000*60;
props["useIpAddress"] = true;
props["socketCacheTimeout"] = 1;
BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider();
TcpClientChannel channel = new TcpClientChannel(props, clientProv);
ChannelServices.RegisterChannel(channel,false);
_ServerURL = string.Format("tcp://{0}:{1}/RDbSyncronizer.soap", adresses[0], LocalPort.ToString());
RemoteSyncronizer =Activator.GetObject(typeof(ServerSyncronizer), _ServerURL) as ServerSyncronizer;
and when a connection fail i call to
RemoteSyncronizer =Activator.GetObject(typeof(ServerSyncronizer), _ServerURL) as ServerSyncronizer;
again.
if i restart the service in the client he connects to the new IP and work until the ip of the server changes again.
|
|
|
|
|
My guess is that some part of the remoting infrastructure is caching server/service combinations, so it doesn't have to go and shake hands with a new server each time you create an instance of a remote object. You will need to call some method to clear that cache or force a reconnection. But I have not worked with remoting so I can't provide any detailed help.
|
|
|
|
|
Member 2416021 wrote: Yes the ip of the server changes and i can ping the server using the new ip
address.
Either that is stated incorrectly or it has nothing to do with what I said.
I have no doubt that the IP changes. And once it changed pinging it would be expected.
That however has nothing to do with DHCP resolution.
|
|
|
|
|
Hello all, I am now learning to program in C#. I initialised an object of OpenFileDialog and set the filter. When the dialog box opens for the first time, everything seems to be OK. Files of the type specified in the filter a shown. But when I change Files of Type to All files which I have set with *.*, the list of files shown is not automatically updated as is expected. I don't know what is wrong. The following is the code I have.
using System;
using System.Drawing;
using System.Windows.Forms;
class MyForm : Form
{
public static void Main()
{
Application.Run(new MyForm());
}
public MyForm()
{
Text = "My Form";
Menu = new MainMenu();
Menu.MenuItems.Add("&File");
Menu.MenuItems[0].MenuItems.Add("&Open...", new EventHandler(FileOpenOnClick);
}
void FileOpenOnClick(object obj, EventArgs ea)
{
OpenFileDialog fodlg = new OpenFileDialog();
fodlg.Filter = "Text Documents (*.txt)|*.txt|All Files (*.*)|*.*";
if (fodlg.ShowDialog() == DialogResult.OK)
{
}
}
}
I am using Visual Studio 2005 with .Net Framework 2.0. From the code above, I have only set the Filter property. When the file open dialog box opens first with Text documents, it works fine but when I change the Files of Type from the combobox to All Files, the dialog box is not updated to show all files. What could be wrong? What am I missing? Please help.
modified on Monday, June 6, 2011 10:01 AM
|
|
|
|
|
There's nothing wrong with the code. Your code has no control over the refresh in the dialog.
The problem has to be something else in your system, though I have no idea what.
|
|
|
|
|
I changed two things to get your code working; added the STAThread attribute and changed the class to OpenFileDialog , as shown below;
[STAThread()]
public static void Main()
{
Application.Run(new MyForm());
}
void FileOpenOnClick(object obj, EventArgs ea)
{
System.Windows.Forms.OpenFileDialog fodlg = new System.Windows.Forms.OpenFileDialog();
fodlg.Filter = "Text Documents (*.txt)|*.txt|All Files (*.*)|*.*";
Bastard Programmer from Hell
|
|
|
|
|
The problem is not in your code. I just checked
with following:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog fodlg = new OpenFileDialog();
fodlg.Filter = "Text Documents (*.txt)|*.txt|All Files (*.*)|*.*";
if (fodlg.ShowDialog() == DialogResult.OK)
{
}
}
}
and it works like charm! Be aware that the dialog class is called OpenFileDialog and not FileOpenDialog.
You should search elsewhere, code is all right!
|
|
|
|
|
hello guys... I wanted to learn the debugging techniques used in professional projects. I am little poor in debugging of projects. Also, it would be nice if I learn how to find the control flow of the project, this is part of debugging, too, I think. Thnx for ur support.
|
|
|
|
|
Console.WriteLine
(sorry, couldn't resist)
|
|
|
|