|
Hello everyone,
I'm now searching about 6 houres to a code, which can change the source IP Address of a IP Packet.
I will send a Packet from my computer (10.48.0.80) to my teacher (10.48.0.121), he will watch the packet traffic with Wireshark. Now he give me the job to search a possible way to change the Packet Source IP which I send to his address.
First I have searched, which socket I have to take: RAW like this:
Socket iSock = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
So, how can I send packets witch the same source and destination IP??
Greets
Stephan
(PS: Sorry for my bad english )
|
|
|
|
|
naezl wrote: First I have searched, which socket I have to take: RAW like this
As far as I'm aware. Raw sockets are not supported from XP SP2 onwards due to the security risks.
You can write an NDIS driver to modify the packet at the network card interface. But that won't be in C#. You'll have to use C or C++
|
|
|
|
|
I need an easy way for user to open my application without the need install dot net framework on his device. If there is no way, I need to no the shortest time consuming version to install?
|
|
|
|
|
If you are running a .NET app, then you have to install the framework, run it as an ASP.NET application or package all of the framework into one executable. The best way to install the framework is to include the .NET redistributable in your installer as a dependency.
There are applications that will merge your application and the .NET runtime together but they do tend to be really expensive and seem to work with varying degrees of success.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
unless you're willing to $pend big buck$ on a tool to natively compile .net apps you need the framework you built the app with on the machine. The 1.0 framework is the oldest, smallest, and presumably fastest to install; but you need VS02 to build with it and it's significantly less capable than newer versions.
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
dan neely wrote: The 1.0 framework is the oldest, smallest, and presumably fastest to install;
and with lot of shortcomings and limitations too...
|
|
|
|
|
Vasudevan Deepak Kumar wrote: dan neely wrote:
The 1.0 framework is the oldest, smallest, and presumably fastest to install;
and with lot of shortcomings and limitations too...
I said that: ...it's significantly less capable than newer versions.
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
hi guys can u help me about how i can record a value which comes in textbox,in txt file??? i wanna do win application..so when i click button i wanna save in txt
|
|
|
|
|
Create a FileStream .
Create a StreamWriter that uses the FileStream object.
Write the Text to the file.
Close the StreamWriter and the FileStream .
|
|
|
|
|
in my application when user adds sth to the db i want to refresh the details updated andshow it to the user, to do this currently i'm using a little trick .. instead of doing this i want really to get the updated info from the db.do i have to reconnect to the db each and every time the user update the db ,OR do i have any other solution .. your suggestions please..
|
|
|
|
|
If you want the data to be read from the db, then you have to connect.
What I think you should be doing is having a data access layer, beneath the businses object you are displaying. If you are displaying a 'person', you would have a person data object. When you have data to save, get the front end / business layer to write the changes to the data layer. This layer should have a 'Save() / Write() / Commit()' method, which you can call when you need to, which will commits the data to the database. This way, the data layer is always in sync with the DB (Assuming nothing else writes to the DB), and you shouldn't need to read from it, only when first loading the object.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Hello all,
I have a c# project in wich I need to display some barcodes. In the past, I've used an Code128 font from http://grandzebu.net/informatique/codbar-en/code128.htm[^]in some c++ projects, and had no problems printing the codes (using gdi).
Now, in the c# project, it uses gdi+ and it seems that it has some problems with some fonts (the code128 included), and always replaces it with Arial.
After searching the net and trying some proposed solutions, I gave up on trying to make gdi+ use the font, so my questions are:
1) Is there any way to convert the font into a format that gdi+ can swallow? (preferably a free one, this is a kind of pet project)
2) Any way of using c++ to draw only the barcode using gdi on the same page that the rest of the program will display the rest of the print output?
TIA
|
|
|
|
|
HI
i have a DataGridView & i like to insert into one of his rows a control
for example i tried :
ComboBox com = new ComboBox();
for (int i = 0; i < 5; i++)
com.Items.Add(i.ToString());
object[] row1 = new object[] { com };
dataGridView1.Rows.Add(row1);
but it display the control string information
if anyone can give me alead ro a new lead (maybe i am at the wrong way)
THNKS
P.S : what kind of controls i can insert
kobkob
|
|
|
|
|
HI,
OOPS, i found out how
thanks anyway
kobkob
|
|
|
|
|
Hi
I have 2 listboxes on my form and in the form load event I want to get values from specified registry keys to appear as items in to each listbox. The first listbox works fine using this code:
RegistryKey key1 = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\RegKey_test");
if (key1.GetValue("MultiString1") != null)
{
ListBox1.Items.Clear();
string[] items = (string[])key1.GetValue("MultiString1");
for (int i = 0; i < items.Length; i++)
{
ListBox1.Items.Add(key1.GetValue("MultiString1", items[i]));
}
}
But for the second listbox I have practically the exact same code (But with a different registry value name and listbox). However, when the form loads ListBox1 shows the correct values but ListBox2 shows 'String[]Array' for each number of multistring values. Here is my code for getting the values from "MultiString2" into ListBox2:
RegistryKey key2 = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\RegKey_test");
if (key2.GetValue("MultiString2") != null)
{
ListBox2.Items.Clear();
string[] items = (string[])key2.GetValue("MultiString2");
for (int i = 0; i < items.Length; i++)
{
ListBox2.Items.Add(key2.GetValue("MultiString2", items[i]));
}
}
Why do I have this error when both sections of code are not that different? Can anyone advise me please?
Lucy
|
|
|
|
|
I have tried changing ListBox2.Items.Add(key2.GetValue("MultiString2", items[i]));
to
ListBox2.Items.Add(key2.GetValue("MultiString2", items[i].ToString));
But the same problem occurs. All registry key and value names are correct.
Stepping through the code I can see that the value for ListBox1.Items is {System.Windows.Forms.ListBox.ObjectCollection}
Should the listbox items be an ObjectCollection?
Lucy
-- modified at 8:03 Friday 28th September, 2007
|
|
|
|
|
Lucy_H85 wrote: string[] items = (string[])key2.GetValue("MultiString2");
for (int i = 0; i < items.Length; i++)
{
ListBox2.Items.Add(key2.GetValue("MultiString2", items[i]));
}
You already got the list from the registry in the first line, then you go and get the list again, and again, and again, and again, and again, for each and every pass through this loop. There's no need to do that. You already have the list in a string array you chose to ignore.
string[] items = (string[])key2.GetValue("MultiString2");
for (int i = 0; i < items.Length; i++)
{
ListBox2.Items.Add(items[i]);
}
|
|
|
|
|
Hi all,
I have an urgent question.
I am writing an windows service to retrieve files from a network drive mapped as Y: I get the following error... Could not find a part of the path "Y:\verify".
When I run an Application it works fine, so I tried to shell the exe from my service, but still get the error!
I have read and tried several things but to no success
Can anyone please assist me?
|
|
|
|
|
The network drive is mapped to a particular user (yours I presume). It is highly unlikely that you are using your user for the service, so it won't be able to see the mapping because this is not present for the user. Your choices are:
1. Rewrite your code to use the UNC path.
2. Change the user of the service to your user.
3. Add the mapping to the user that the service runs against.
Option 1 is your best option (oh, and don't hardcode the value - pick it up from a config file so that you can change it later on.)
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanx for the quick reply
If I use Option 1, the share uses Authentication. It's basically a DMZ share...
How can I then authenticate the service?
If I use Option 2, I have tried to set the Log On of the service to my domain logon, thought it would then see my mapped drive???
Under which ServiceAccount type should I install the service?
Any advice here?
|
|
|
|
|
This is most likely because your service is running under the local account. A local account is just that - local. You can either configure the service to run with a specific user's credentials (I've done this and it works) or use a UNC path (I haven't tried this, so I don't know).
Cheers,
विक्रम
And sleep will come, it comes to us all
And some will fade and some will fall
|
|
|
|
|
Hi thanx for the reply!
I ran the service using my domain login, I thought that this will allow the service to see MY mapped drives. But still got the same error.
Under which ServiceAccount should I then install,localService, Network Service?
Please assist this is of great importance
|
|
|
|
|
|
Mapping drives is so '80s; use a UNC.
|
|
|
|
|
the '80s were great, so mapping drives also
|
|
|
|