|
That link does not give me enough information to solve my problem.
|
|
|
|
|
Ok, sorry, I guess I was wrong. I won't bother you any more.
|
|
|
|
|
dptalt wrote: That link does not give me enough information to solve my problem.
You probably read something about office automation, then it would.
|
|
|
|
|
Hi all,
I need a small tip on the following;
I have an assignment were I need to create a sort of a server on which I will have an application running (which application has to be created by myself). This application should be able to read the packets received on the server ethernet card, manipulate the packets (the actual bits) and output the modified packets on another ethernet card (or if possible the same card used as input).
I need some feedback if it is possible to create such an application, which will be able to perform such job, and if possible, how difficult it is to make (is there any ready to use dll files or classes that can perform parts of this job like for example reading and writing to/from the ethernet card?)
Hel from your side will be greatly appreciated.
regards
sandro
|
|
|
|
|
Your question has been sitting there for some time with no response.
There are several reasons for this.
1) You say this is an assignment. That makes it sound like homework but you have not indicated what, if any, research you have done. No one here is likely to do your homework for you.
2) The whole concept sounds highly suspicious. The sort of thing that a malicious program might do. I'm not suggesting that it is, but you do nothing to dispel that impression.
So do some research for yourself. Find something that you can adapt or copy and have a go. When you get problems with a specific part of your code, please come back, with code snippets, details of any errors (including precise error messages) or behavioural problems.
Good Luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
thanks for the tips Henry!
By assignment I meant that I need to perform some research, and the whole concept of the program is that I convert from a particular SCCP protocol to another SCCP protocol.
I posted this question not to have any particular code but to have some feedback if this program is doable by using C#.
thanks again
|
|
|
|
|
Well i know that i can´t play directly with values of winforms from different thread of the UI thread.
But i have a thread and i need to obtain the value of a checkbox from that thread... how can i obtain the value??
Thanks in advance.
|
|
|
|
|
Create a Class "cls" :
class MyCls
{
public static bool MyCheckBoxValue;
}
and change this variable from your forms by call it like this :
MyCls.MyCheckBoxValue = true;
or
bool mybal = MyCls.MyCheckBoxValue;
I know nothing , I know nothing ...
|
|
|
|
|
Hi,
for minimal run-time cost, give the Form that holds the CheckBox:
1. a private bool holding the state of the checkbox;
2. a CheckBox_CheckedChanged event handler, updating said variable;
3. a public property to get the value of said variable.
this set-up avoids the need for Control.Invoke
PS: don't forget to copy the initial CheckBox.Checked value in your form's constructor.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
I have an other Thread t,and I can get the checkbox value from UI thread in Thread t.
see follow source code.
private void Form2_Load(object sender, EventArgs e)
{
Thread t = new Thread(new ThreadStart(deal));
t.Name = "deal";
t.IsBackground = true;
t.Start();
}
void deal()
{
while (true)
{
System.Diagnostics.Debug.WriteLine(checkBox1.Checked);
Thread.Sleep(1000);
}
}
|
|
|
|
|
private void LoadSettings()
{
string[] lines = File.ReadAllLines("settings.txt");
foreach (string line in lines)
{
if (line == "" || line.StartsWith(" ") || line.StartsWith("/")) continue;
string[] splitArray = line.Split(new char[] { '=' });
MessageBox.Show(splitArray[1]);
}
MessageBox.Show(splitArray[1]);
}
Im having a problem with the code above the array splitArray can be accessed inside the for-each loop but i get a ide exception if i try to access it anywhere else . Is there any way to make the array items available anywhere in the form ?
|
|
|
|
|
Make it a class level variable.
जय हिंद
|
|
|
|
|
Yes. Make it a private field of your class, rather than local to a single routine:
class Whatever
{
private string[] splitArray;
private void LoadSettings()
{
string[] lines = File.ReadAllLines("settings.txt");
splitArray = null;
foreach (string line in lines)
{
if (line == "" || line.StartsWith(" ") || line.StartsWith("/"))
{
continue;
}
splitArray = line.Split(new char[] { '=' });
MessageBox.Show(splitArray[1]);
}
MessageBox.Show(splitArray[1]);
}
}
Don't forget to check for null before you use it outside LoadSettings
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Ah that works perfectly im still learning c# , Last problem
private void LoadSettings()<br />
{<br />
string[] lines = File.ReadAllLines("settings.txt");<br />
foreach (string line in lines)<br />
{<br />
if (line == "" || line.StartsWith(" ") || line.StartsWith("/"))<br />
{<br />
continue;
}<br />
splitArray[spl] = line.Split(new char[] { '=' });<br />
}<br />
MessageBox.Show(splitArray[0]);<br />
}
c# seems to be adding the items to the array in reverse from start to finish not at the end of the array . Is there any way to make the items add to the end of the array rather than the start ?
|
|
|
|
|
Hi,
some comments:
1.
please show code snippets with PRE tags, not CODE tags; you can use the "CODE BLOCK" widget below the edit window for that.
2.
you store the splitted line in splitArray[spl] yet you show splitArray[0].
Not sure what spl stands for, but this might explain your symptoms.
3.
No need to write line.Split(new char[] { '=' }) , a simple line.Split('=')
does exactly the same (the compiler takes care of the char[]).
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
splitArray[spl] ? i haven't defined spl anywhere ?
its just ment to start at splitArray[0] with the first setting and build on after that with the last setting at splitArray[13]
|
|
|
|
|
The you need a loop - either a for(i = 0; ...) or a foreach(string s in...)
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I am creating a application on C# its a very basic application
structure:
Camp>>Blocks>>Rooms>>Beds
every room can have different no. of beds up to 4
I have to create a reservation screen, any ideas how can I do that?
Regards
Amit
|
|
|
|
|
It looks like a school home work, btw what have you tried till now?
Before starting to code, you need to sit and think of a design.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
The way I always approach this is to sort out the code structure first on paper.
Once you have an outline of the various classes and interfaces along with the basic methods and properties that will be needed you pretty much have your business layer sorted. Designing a UI and a data structure is now pretty easy.
If you do the UI first you will be restricting your code's logic to some extent on the way the data is presented which is going to be painful.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
Hi
This is probably a stupid question, but how do you draw borders for the cells of a DataGridView.
I've read plenty but cannot make it work.
I want to draw a vertical line down between two columns from top to bottom of the grid.
This is what I have so far, it doesn't do anything though:
myColumn.CellTemplate.AdjustCellBorderStyle(new DataGridViewAdvancedBorderStyle { Right = DataGridViewAdvancedCellBorderStyle.OutsetDouble },
new DataGridViewAdvancedBorderStyle { Right = DataGridViewAdvancedCellBorderStyle.OutsetDouble },
true, false, false, false);
|
|
|
|
|
I like playing with DataGridViews , so your question interested me. I've done some searching, but the only real examples I can find are overrides of AdjustCellBorderCell for custom columns/cells.
Other sources seem to say the effect can only be observed if the cell/column is selected/in edit mode, depending on who posted the solution. Have you tried both of those situations?
Other than that, and this is pure guesswork (untried)
myColumn.CellTemplate.AdjustCellBorderStyle(new DataGridViewAdvancedBorderStyle { Right = DataGridViewAdvancedCellBorderStyle.OutsetDouble },
new DataGridViewAdvancedBorderStyle(),
true, false, false, false);
might work. The blank placeholder bit is used in a couple of the examples I found.
As I said pure guesswork.
I'm off to play now, so if I get a hit, I'll come back.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Have you seen this[^] from MSDN?
I have modified it slightly
public class DataGridViewCustomCell : DataGridViewTextBoxCell
{
public override DataGridViewAdvancedBorderStyle AdjustCellBorderStyle(
DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput,
DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceHolder,
bool singleVerticalBorderAdded,
bool singleHorizontalBorderAdded,
bool firstVisibleColumn,
bool firstVisibleRow)
{
dataGridViewAdvancedBorderStylePlaceHolder.Left =
dataGridViewAdvancedBorderStyleInput.Left;
dataGridViewAdvancedBorderStylePlaceHolder.Top =
dataGridViewAdvancedBorderStyleInput.Top;
dataGridViewAdvancedBorderStylePlaceHolder.Right = firstVisibleColumn ?
DataGridViewAdvancedCellBorderStyle.Single :
DataGridViewAdvancedCellBorderStyle.OutsetDouble;
dataGridViewAdvancedBorderStylePlaceHolder.Bottom =
DataGridViewAdvancedCellBorderStyle.None;
return dataGridViewAdvancedBorderStylePlaceHolder;
}
}
which works pretty well.
Still haven't found a way to do it at runtime though.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello,
I am using microsoft.office.interop.excell to write to excell file.
But i have a problem of saving it.
If i do workbook.saveas and the file exists it asks me if to save it and it rewrites me it (removes the old data).
if i specify it to open a file when i create the workbook:
Microsoft.Office.Interop.Excel.Workbook objBook = ExcelApp.Workbooks.Open(@"c:\Focus Report\123.xls", 0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);
and the file doesn't exist it cannot save and throws and exception that the file wasn't found.
So how can i save the file (create if not exist and save it (not rewrite) it if exist)?
|
|
|
|