|
and Discrete Math go into the topics at depth. Basically 0xF is the hex representation of 1111 in binary (15 in decimal). 1111b (b for binary) << 4 = 11110000b which is 0xF0 in hex. 0xF0 | 0x0F = 0xFF (bitwise or), 0xF0 & 0xF0 = 0x00 (bitwise and). Also 0x0f & 0x01 = 0x01 (bitwise and)
I really can't go into it further because it can get fairly immense.
File Not Found
|
|
|
|
|
Thats a great intro, I am familiar with hex but didn't understand how the operator worked.
I will read up on Boolean Algebra and Discrete Math as you suggest. I would like to know more but understand that this is beyond the forum.
Thanks for your guidance.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Greetings everybody,
I have a nice challenge:
I have a gridview and an objectdatasource on a webpage and I made this gridview invisible.
I need to use this gridview multiple times on one webpage with the same objectdatasource but the values of the parameters of the stored procedure differs from case to case.
I want to use a clone technique or something else to accomplsh this.
I need to use c# code.
Does somebody have a clue how I can accomplish this?
Thanks for every clue.
Greetings Peter Bellen
bellenp@schneider.com
|
|
|
|
|
What's to stop you simply creating the GridView manually rather than using the designer. Refactor that code out into a method called CreateGridView with parameters that allow you to pass through to the stored procedure. Then (I don't know the Web Forms equivalent) you can call:
this.Controls.Add(this.CreateGridView(paramater1, parameter2, ...));
this.Controls.Add(this.CreateGridView(parameter2, parameter3, ...));
|
|
|
|
|
I got some problem about send multiple parameter to crystal report. I already create parameter field with allow multiple value option, but when I look into preview windows in crystal report program. It'll prompt me to put multiple value, which is right, but when I entered two value, it only show me for one value. Ex, I entered "test1" and "test2" values, but in preview I only can see "test1". Please give me some guide!!!! thank you
|
|
|
|
|
Hello everyone,
I am working on an Windows Application writen in C# which gets connected to a remote Database server. I am trying to get the IP address of the use once they get connected to the database.
I am using the following code for getting the IP address:
string strHostAddress = "";
IPAddress[] addresslist = Dns.GetHostAddresses(strHostAddress);
foreach (IPAddress theAddress in addresslist)
{
MessageBox.Show(theAddress.ToString());
}
It works fine but the code returns the enternal IP address since my computer is sitting behind a routher.
I was wondering if it is possible to get the external IP address?
Thank you very much and have a great day.
Khoramdin
-- modified at 18:32 Monday 19th March, 2007
|
|
|
|
|
How about using an external service such as whatsmyip.org[^] to find out the router's IP address. Not to overload those servers it isn't to difficult to create a simple script or web page that you can host yourself to return the IP address of the computer making the connection.
|
|
|
|
|
Hello Ed,
Thanx for the info. I have spent a good deal to time and trying everything and it seems your suggestion is the only way to go about this.
Just wanted to say thank you and have a great day, mate.
Khoramdin
|
|
|
|
|
I would like to know what the recommended max length for a filename/path for Windows XP is...if there is one?
-- Thanks!
|
|
|
|
|
|
Thanks for the link. I am at work and did not have the time to research that. Once again thank you and "yes" that is the information I was looking for.
--cheers
|
|
|
|
|
Hi,
I have a main form.
I then want to have a second form which only asks me for a URL.
I call the second form within the main form in the following way:
<br />
URL u = new URL();<br />
u.ShowDialog();<br />
Once i done everything i have to do in the second form i want to click ok and return:
<br />
private void btnOk_Click(object sender, EventArgs e)<br />
{<br />
bool valid = true;<br />
try<br />
{<br />
Uri url = new Uri(tbAddress.Text);<br />
valid = true;<br />
}<br />
catch (Exception error)<br />
{<br />
MessageBox.Show(error.Message);<br />
valid = false;<br />
}<br />
<br />
if (valid)<br />
{<br />
MessageBox.Show("URL is valid!");<br />
this.host.Valid<br />
}<br />
<br />
}<br />
How can i retrieve the value of the second form in the sequence of its call?
Thx,
Nuno
|
|
|
|
|
You can make a public property in the URL form that exposes the Uri
Like:
1- add private variable:
Uri url = null;
2- property accessor:
public Uri SelectedUri
{
get
{
return this._url;
}
}
and change this line:
Uri url = new Uri(tbAddress.Text);
to:
this._url=new Uri(tbAddress.Text);
in the parent form, read the property:
URL u = new URL();
u.ShowDialog();
Uri url=u.SelectedUri
|
|
|
|
|
Expose a Property on this second form that holds the Uri that you saved, but let fall out of scope in this code:
bool valid = true;
try
{
Uri url = new Uri(tbAddress.Text);
valid = true;
}
All of these variables get created and set, then drop out of scope before your main form gets a chance to pick this data up. Create a Property on your form when when the user clicks OK, you set the property to the Uri, then set the DialogResult to OK and dismiss your form. Then the main form can check the DialogResult of your second form and, if OK, can pick up the value of that property.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
The easiest way is by making the textbox or whatever data you want to retrieve from this form public. After the ShowDialog method, the values will still be present, and you can just access them (because you made them public). For UI controls you can use the 'modifiers' in the properties window.
-edit: sorry, didn't see the other replies. They're more detailed.
public object BufferOverFlow<br />
{<br />
__get { return BufferOverFlow; }<br />
__set { BufferOverFlow = value; }<br />
}
|
|
|
|
|
One simple question:
How can i tell to a button which is meant to be a OK button, to be pressed when I hit enter?
Thx,
Nuno
|
|
|
|
|
by making it the forms' AcceptButton.
Go to your form, and change the AcceptButton property to your OK button. The function does more than just close your window, so look it up before you start using it fully.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Thx people!
Your replies were very usefull!
Thx,
Nuno
|
|
|
|
|
Sorry for my bad English!
I don't know how to communicate between forms and classes.
At start i have a form form1. From here i create an instance of a class for networking und communication with a server. After couple of hours i found out how i can change elements of form1 from the network class (with referencing). But, what is when i go back to form1 and create with a button a new class of (for example) database. How can I communicate with previously created network class AND change propertys in form1?
In Visual Basic it is very easy, but c++ and c#...
Thank you very much!
waldi
|
|
|
|
|
I did not understand the question
If you believe that it's easier in vb, Please post the vb code that makes the same functionality (or a similar one) and let us convert it to C#.
|
|
|
|
|
ok.
Here is a basic sample in VB .NET
http://www.waldemarhuber.de/vbtest.zip
<VB>
there are two forms and a class.
Form1 initializes Form2 -> Form2.Show()
Form2 declares an instance of a class
-> Dim obj As New Class1()
Here is the code of Class1:
Public Class Class1<br />
<br />
Sub New()<br />
MessageBox.Show("hm")<br />
Form1.Text = "test"<br />
End Sub<br />
<br />
End Class
As you can see, I change the caption of Form1 to "test" without problems.
In C# I can't do any changes from the class on Form1 neither Form2, and when i initializes the class from Form1 I also can't do something with Form1. With referencing in the class like this
<c#>
class network<br />
{<br />
private Form1 form_ref = null;<br />
<br />
public network(Form1 f)<br />
{<br />
this.form_ref = f;<br />
form_ref.Text = "hm";<br />
}<br />
...
it does good job. But if I make an instance of a some new class of (for example) database out of class network, I can't change things on Form1 like filling textboxes and so on.
I hope you understand now.
Thank you!
waldi
|
|
|
|
|
You've got serious design issues. This thing is very quickly degenerating into a pile of spaghetti. The VB.NET code is just about directly convertible to C#. But, just because you could do it in VB.NET, doesn't make it a good thing to do.
For example, you're totally violating the concept of encapsulation. The name of your class is "Network". Why is this class concerned with ANYTHING to do with the UI?? It shouldn't be doing anything with the user interface at all.
The Network class' sole concern should be whatever you're doing with the network. Should it need to pass changes or data back to the form that is calling it, it can do this using properties, callbacks, and/or events. This way, you can have ANY form use your Network class without any worries about having certain TextBox controls on your form.
What if you try to use you new Network class in a Windows Service or in a Console app, neither of which have a form?? Well, you'll have to rewrite this class to support these things...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Does C# have any advanced string parsing functions other than the ones in the System.Text namespace?
|
|
|
|
|
|
System.Text.RegularExpressions
Regular Expressions are about as good as you can get for string parsing...
Hogan
|
|
|
|