|
To do this by applicaiton, the application has to be "aware" of the different network interfaces. As is applications like IE and MSN Messenger frankly don't know and don't care as long as the routing can contact the servers it seeks to query. For some applications, mostly server programs like IIS, this makes sense since they "bind" to specific interfaces so they provide tools to handle this. For client software this is behavior is almost meaningless.
I would say its nearly impossible to manipulate the routing to be application aware (I don't want to say it is impossible but it should be darn near impossible since it would be easy to write malicous software if you could just hijack traffic out of process). There is probably a way but it involves some serious win32 mojo to recognize what application is opening what socket and then altering the communication path accordingly.
I believe this is a case where someone is trying to solve something with software but ignoring the obvious (and distrubingly easy) hardware solution: take a modem off of the machine and place it on another and run your applications as applicable.
|
|
|
|
|
lol...
Maybe Bill can handle this, because he has the sources of Windows...
That could be a nice extension to Longhorn Server
There is no spoon.
|
|
|
|
|
But why would you want to? Routing is a software abstraction that is there for a reason: without routing every application that wants to make a socket connection on the internet would have to enumerate and judge for themselves what network interface to use.
The cost of adding a feature like this outweighs the actual benifit. Applications need to get simpler not more complex. Adding something to Longhorn to individually route each and every process would be a control nightmare.
Your problem would be solved in half an hour by moving one modem to another machine and running the applications seperately.
|
|
|
|
|
bouli wrote:
That could be a nice extension to Longhorn Server
and an absolute bastard to troubleshoot and administer...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
of course!!! they are here for that!!!
that could be useful for companies that have several network connections. "Bridging" is a first step... next step should be to make the applications aware of the connection to use!
There is no spoon.
|
|
|
|
|
I want to know how I can set my machines IP address in c# coding?;)
Sweet
|
|
|
|
|
There's nothing in the .NET FCL that allows you to set your machine's IP address. In fact, it's not a good idea to, anyway. It's not like some user preference that could be changed often.
In any case, such an API is not documented in the Platform SDK. Obviously there's some way to do it, but that doesn't mean it's documented.
If you want to get the machine's IP address, a simple way is like so:
string name = Environment.MachineName;
IPHostEntry host = Dns.GetHostByName(name);
foreach (IPAddress address in host.AddressList)
if (address.AddressFamily == AddressFamily.InterNetwork)
return address;
return null; This would get the IPv4 address, for example.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you very much.
Sweet
|
|
|
|
|
Hi Gurus!
I would like to know where I can get information about Network Bandwidth management, Load Balancing management and Modem management? Where are the informations about these subjects with APIs etc.??? I don't find much about this in the MSDN Library...
Thanks.
Best regards to all.
There is no spoon.
|
|
|
|
|
While u could write a client interface in C#, most of the nitty gritty is at system level, hence C/ASM and knowledge how to write a network bridging device driver. I suggest you get something to look at in Linux (there are many) and see how you can port it to windows. There mite even be open source for windows (search for winpcap related stuff).
top secret xacc-ide 0.0.1
|
|
|
|
|
Is there a way to populate a combobox wiht data in a listview. And use the combobox in different forms. For example the listview on form1 contains fist name column, last name column, and account number column. On Form2 I have 3 textboxes (firstName, LastName, accountNumber)a combobox that I want to contain data from the listview on form1. When the user selects an item in the combobox I want it to fill the textboxes with the appropriate data.
|
|
|
|
|
to make the comboBox contain the same data of the listview(limited to 1 column only) you can set the DataSource property of the comboBox to listView1.Items and the DisplayMember property to Text .
in the SelectedIndexChanged event of listView1 object , edit the Text property of the 2 textBoxes:
private void listView1_SelectedIndexChanged(object sender, System.EventArgs e)<br />
{<br />
textBox1.Text=listView.SelectedItems[0].Text;<br />
textBox2.Text=listView.SelectedItems[0.SubItems[0].Text;<br />
}
|
|
|
|
|
I'm stuggling with the readability of my aspx code. How would you format something like this?
<asp:DataGrid
Runat="server" ID="ExceptionGrid"
Width="100%" AutoGenerateColumns="False"
EditItemStyle-BackColor="#ffffcc"
AlternatingItemStyle-BackColor="#66CCFF"
ItemStyle-BackColor="White"
ItemStyle-Font-Name="verdana" ItemStyle-Font-Size="13px"
BorderColor="Black" AllowPaging="True"
PageSize="15" pagerstyle-cssclass="psClass"
onpageindexchanged="ExceptionGridPageChg"
onupdatecommand="ExceptionGridUpdate"
oneditcommand="ExceptionGridEdit"
oncancelcommand="ExceptionGridCancel"
OnSortCommand="ExceptionSortCommand"
datakeyfield="wpr_node_id"
AllowSorting="True">
[Edit] Oh and why won't VS.NET give you the dropdown of the attribute list if you put each attribute on it's own line? Talk about fraustrating[/Edit]
|
|
|
|
|
AFAIK .NET2 will write attributes on seperate lines, for now you are stuck, unless you learn not to use that excuse for a designer
top secret xacc-ide 0.0.1
|
|
|
|
|
Ok, but please tell me there is a way to tell VS.NET to stop autoformatting my code everytime I close the file and reopen it. I'll put each of the attributes on its own line, but as soon as I open the file they are all on one line again and I can't find the setting to get rid of that.
[Edit] Just found it under the tools/options/text editor/html/format [/Edit]
|
|
|
|
|
|
|
Adam Wimsatt wrote:
What do you use?
For? XML editing? Personally i feel XML is merely for data storage, not editing (not sure what the point of XAML is really ). HTML I pretty much steer clear off.
top secret xacc-ide 0.0.1
|
|
|
|
|
Speaking of formatting, don't use both the <pre></pre> and <code></code> tags together. Use CODE to in-line code within your text, or PRE to have a formatted block. They are to be used the same as you'd do for articles here on CodeProject (and other places).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
Hi:
I have a datagrid in my windows application, which is being populated through a dataset.
The records in that grid are grouped according to GroupNumber field. As an example, let’s say there are 3 records with GroupNumber=99, 5 records with GroupNumber=24, 3 records with GroupNumber=67, and 1 record with GroupNumber=87. The total number of records in my grid is 12 records.
I would like to have blue back ground color for records whose GroupNumber=99; and gray/white back ground colors for the rest of records such that no adjacent groups have the same color (i.e. considering 2 adjacent groups, the back ground color for one group should be gray and the other white).
Any clues, ideas, or suggestions would greatly be appreciated since I am stuck and have no idea how to implement that constraint on my datagrid. Thank you very much in advance!
|
|
|
|
|
The DataGrid is a very light-weight control that isn't nearly as extensible as its future replacement, the GridView (to be released with .NET Framework 2.0). In order to do this, you'll need to use deriviative DataGridColumnStyle s for each column and color them accordingly.
See Changing the background color of cells in a DataGrid[^] here on Codeproject for an example.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have the following problem:
I have 2 classes: MyClass1 and MyClass2. MyClass1 contains a collection ArrayList of MyClass2 objects. In MyClass1 I implement the ISerializable interface. How do I write the constructor for deserialization, especially when I deserialize MyClass2 object?
//Deserialization constructor
public MyClass1 (SerializationInfo info, StreamingContext context) <br />
{<br />
simpleVar1 = (int)info.GetValue("simpleVar1", typeof(int));<br />
simpleVar2 = (String)info.GetValue("simpleVar2", typeof(string)); //and so on with the simple members of MyClass1
//Deserialize MyClass2 objects from the ArrayList (member of MyClass1)
????????????????????????????????????<br />
}
Thanks for the help!
Best regards,
Cristina
|
|
|
|
|
You don't deserialize your MyClass2 objects from the ArrayList , you deserialize the ArrayList . The ArrayList will be deserialized which deserializes each instance of MyClass1 . It's an object graph and unless you plan on serializing an entire object graph from a single class (not a good idea), this is how it works.
Likewise, when you serialize your object, you serialize the ArrayList . The runtime serialization framework will then serialize its elements, then serialize those elements' members, and so on.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Check this code out:
string path = MapPath("faq.xml");
DataSet ds = new DataSet();
ds.ReadXml(path);
XMLGrid.DataSource = ds;
XMLGrid.DataBind(); faq.xml looks like:
<faq>
<sub>
<q>stuff here</q>
<i>stuff here</i>
<a>stuff here</a>
</sub>
<sub>
<q>stuff here too</q>
<i>stuff here too</i>
<i>note this is I</i>
<a>stuff here too</a>
</sub>
</faq> Note that there are two <i> tags in the second sub and only 1 in the first. The code for reading this xml file is a autogenerate columns datagrid and what I get is: Submission_ID and numbers in the column for i instead of two i columns.... I'm guessing there is a way to use the Submission_ID to get at that data, but I'm not sure how to do it programatically. I haven't been successful in googling yet... Any ideas? The following code prints the same Submission_id thing as the datagrid does:
foreach (DataRow dr in ds.Tables[0].Rows)
{
for ( int i = 0; i < dr.ItemArray.Length; i++ )
{
PrintString(dr[i] + "<br>");
}
PrintString ("<br>");
}
side note: How do you use a < in <code> tags without having to type in the html code for it each time?
|
|
|
|