|
Because C is not an object oriented language there is no type information at all.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
Hi everybody!
I got a simple question:
i must create an application which automatically connect the computer to internet at startup.
How can i do something like that?
Thank you in advance
Enrico
VentoEngine corp.
Program your life ^^
|
|
|
|
|
|
Hi..
I have a regular expression validation control called RegularExpressionValidator_FName. I'm want to create a global function in my Globals.cs class where I pass it this control so that I can set it's ValidationExpression to a global variable also saved in my Globals.cs class.
If the function is called ConcatenateRegExp(), then I would call it like ConcatenateRegExp(RegularExpressionValidator_FName); ??? If this is correct, I don't understand how the function definition would look like, meaning I don't what type the argument would be of. Would it be something like:
public void ConcatenateRegExp(System.Web.UI.WebControls myControl)
{
myControl.ValidationExpression = "\d";
}
Please can someone tell me if my call is correct, and that the function is correct.
Regards,
ma se
|
|
|
|
|
Hi,
I created a web page program which can upload attachment.
My concern is the correct way to handle attachment in web.
What I am doing right now is if the user CLICK the ATTACHMENT BUTTON but not yet pressing the SUBMIT BUTTON (which is save) I am inserting the current information in my first table with a Temporary key in order for me to have a referrence in my Attachment File. Once the user Click the Attach Button in the ATTACH PAGE I will save the files in the attach table with the temporary key.
Once everyting is complete when the user CLICK the SUBMIT BUTTON I update both the temporary key to the STANDARD key.
Is what I am doing is correct?
BEFORE PRESSING SUBMIT BUTTON - USER CLICK ATTACHMENT BUTTON FROM MAIN PAGE
MainTable
Key = "tmp1"
User= "TestUser"
Information = "Test Information"
date = Datetime.Now;
AttachTable
Key = "tmp1"
User= "TestUser"
AttachFile= "test.xls"
date = Datetime.Now;
USER PRESSED SUBMIT BUTTON
MainTable
FROM Key = "tmp1"
NEW Key = "06030001"
User= "TestUser"
Information = "Test Information"
date = Datetime.Now;
AttachTable
FROM Key = "tmp1"
NEW Key = "06030001"
User= "TestUser"
AttachFile= "test.xls"
date = Datetime.Now;
|
|
|
|
|
How can I display a HTML table in a winform control like textbox or lable or any other control? Please help me ASAP...
|
|
|
|
|
If you're using .NET 2.0, you can use the WebBrowser[^] control to the display the table on your form or composite control.
|
|
|
|
|
.Net 1.1, Is there any way to do this over there?
|
|
|
|
|
I have a crystal report done and I am trying to call that thru win forms.I use VS 2005 and C#.
I get one error msg telling 'Load report failed'.I have 2 parameters to pass to the report.I use a stored procedure for the report.My code is given below:
The line doc.load() which loads the report is showing the error:
if (cmbLocation.SelectedIndex == 0)
cmbLocation.SelectedValue = "NULL";
else
cmbLocation.SelectedValue = cmbLocation.SelectedItem.ToString();
if (cmbDept.SelectedIndex == 0)
cmbDept.SelectedValue = "NULL";
else
cmbDept.SelectedValue = cmbDept.SelectedItem.ToString();
string reportPath = Application.StartupPath + "\\" + "crAbsenceToday.rpt";
//Instantiate variables
CrystalDecisions.CrystalReports.Engine.ReportDocument doc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
ParameterField paramField = new ParameterField();
ParameterFields paramFields = new ParameterFields();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
//Set instances for input parameter 1 - @DEPTNAME
paramField.Name = "@DEPTNAME";
paramDiscreteValue.Value = cmbDept.SelectedValue;
paramField.CurrentValues.Add(paramDiscreteValue);
//Add the paramField to paramFields
paramFields.Add(paramField);
//Set instances for input parameter 2 - @LOC
paramField = new ParameterField();
paramField.Name = "@LOC";
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = cmbLocation.SelectedValue ;
paramField.CurrentValues.Add(paramDiscreteValue);
//Add the paramField to paramFields
paramFields.Add(paramField);
crv1.ParameterFieldInfo = paramFields;
doc.Load(reportPath);
//Load the report by setting the report source
crv1.ReportSource = doc;
I am trying to solve this for the last 4 days...plz help me to sort it out.
Thanks in advance.
|
|
|
|
|
Hi,
In SharpDevelop 1, when it would "fold" a class, it would do it the same way it does a method, where the [...] was at the end of the declaration, like this:
public class TestClass [...]
Now, in SharpDevelop 2.0, when you fold a class, it just displays the [...], and hides the class declaration. That is very annoying, is there any way to change that?
Any help would be appreciated.
|
|
|
|
|
I have the following code:
try
{
statusLabel.Text = "Attemting to connect...";
DataCon.Open();
....
}
Why dosn't "Attempting to connect..." show in the status bar until it has connected?
|
|
|
|
|
Use Application.DoEvents()
<br />
try<br />
{<br />
statusLabel.Text = Attempting to connect..."; Application.DoEvents();<br />
DataCon.Open();<br />
}<br />
Basically calling the Application.DoEvents() forces your application to process everything up that point before proceeding to the next step in your code. Without it your user interface will appear to lock up until your done working with your data connection stuff. The other way to accomplish this would be to spawn your data connection stuff on another thread which then would make the main thread process the UI changes.
I reject your reality and substitute my own!
- Adam Savage, Mythbuster
-George W Bush
life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
My definition of an expert in any field is a person who knows enough about what's really going on to be scared.
- PJ Plauger
|
|
|
|
|
Thanks! Thought it would be something small like that. Works fine now
|
|
|
|
|
the StatusBar component is a little tricky. Does your StatusBar have panels? If so you should be addressing the panel to which you want the data to appear. For example, say you had statusBar1 and statusBarPanel1 defined in your app. Use statusBarPanel1.Text = "blah blah blah".
Good luck
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
I am trying to supply an hDC to a dll that needs a picture drawing area. I think i have 2 choices:
1. Use Form1 itself and just specify where the dll should draw the object.
2. Use a PictureBox1.
I do not understand the structures well enough to know if i can:
a. use the windowHandle of Form1 as an hDC.
--- Does the windowHandle qualify as an hDC? If not, how can i get a suitable hDC for Form1?
b. get the hDC of pictureBox1.
--- I need the hDC in an event-handler (a Form1 keypress event) that does not have access to an e argument that allows: hdc = e.Graphics.GetHdc(); .
All suggestions are welcome.
Thank you.
|
|
|
|
|
A window handle cannot be used as a hDC (device context).
If you want to get the hDC for any control or form, use something similar to this:
Graphics g = [this/pictureBox1].CreateGraphics();
g.GetHdc();
|
|
|
|
|
You'll need to give us more information about what you want and need to do before we can help. Your description is rather vague.
What re you using to create the line graph? What database engine are you proposing to use?. What is this 24 hour time contraint? etc...
Is this perhaps for an assignment, project, or real-world application?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
my problem is how can i tracks a server's response times and records the results of all monitoring requests into its built-in database. using Historic monitoring data and can analyzed for uptime/down time reports and trend analysis.
need help... thanks in advance.
|
|
|
|
|
Don't reinvent the wheel if you don't need to. A Google search[^] for DB performance monitoring tools which use Windows Performance Monitor data shows that several are available.
If you really need to roll your own, then you'll need to research how to interect with the Perfomance Counters (just type in performance counters into the Code Project search bar at the top of the page for several articles on how to do this).
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
i am trying to get the ip address of host on windows application
thanks
openup your heart and let the sun shine in
|
|
|
|
|
Try these search terms in The Code Project search...
ip address of host
You will find plenty of hits. One of them is bound to do what you want or at the very least point you in the right direction.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
thanks for your reply Steve , i'll learn to fish
openup your heart and let the sun shine in
|
|
|
|
|
Pretty simple if you are programming with sockets.
If TCP, then you can refer to the IPEndPoint object after establising a connection OR accepting one.
If UDP, each message is self identifying so you can extract the Host IP from the header.
If you problem is not covered by Socket Programming, then let me know. Also there are about a zillion examples of TCP and UDP client between this site and if u google the net.
Good luck
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
thanks for your reply Mike,
i found this code
String strHostName = Dns.GetHostName();
// Find host by name
IPHostEntry iphostentry = Dns.GetHostByName(strHostName);
// Grab the first IP addresses
String IPStr = "";
foreach(IPAddress ipaddress in iphostentry.AddressList)
{
IPStr = ipaddress.ToString();
}
i am trying to do a chat program(socket programming it is my homework client send message to another client through the server) my time is over tomorrow ,unfortunately i couldnt fnish but i liked very much socket programming and i will search about, is there any article about socket programming you advise
openup your heart and let the sun shine in
|
|
|
|
|
If you are referring to the local PC as host you could use WMI to retrieve the IP address.
<br />
using System.Management<br />
<br />
public ArrayList ActiveIP()<br />
{<br />
ObjectQuery oq = new ObjectQuery("Select * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=true");<br />
ManagementObjectSearcher mos = new ManagementObjectSearcher(oq);<br />
ArrayList NA = new ArrayList();<br />
<br />
foreach(ManagementObject moInfo in mos.Get())<br />
{<br />
string[] IP = (string[])moInfo["IPAddress"];<br />
NA.Add(IP.GetValue(0).ToString());<br />
}<br />
<br />
return NA;<br />
}<br />
This will return all the IP address the PC has.
Hope this helps!
I reject your reality and substitute my own!
- Adam Savage, Mythbuster
-George W Bush
life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
My definition of an expert in any field is a person who knows enough about what's really going on to be scared.
- PJ Plauger
|
|
|
|