|
I guess your English is REALLY bad. I just said that we will NOT make fun of you or care that your English is not good, because this site has users from all over the world.
zez0 wrote: if this is your way of your replay ,so i don't need your replay
I've given you the answer you need several times, and reassured you that your poor English is not an issue. I'd suggest you read my replies carefully again, and take a few deep breaths.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Use this[^] or this[^].
There are plenty of ways by which one can define methods. And thus, it won't be easy to take care of all the conditions while finding them in a cs file.
Another option could be to load the assembly instead of cs file then get the details through reflection.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
hi
how i can disable BT and WIFI in windows mobile, using C# ?
can i get sample code for it ?
thank's in advance
|
|
|
|
|
I searched google ( did you ? ) and confirmed that there's no standard way to do this, you'd need to read the documentation for the different devices you run on to see if they offer any sort of support that you can hook into.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
is there a generic solution ? something in the .net ?
|
|
|
|
|
Yes, there is. That's why I told you there isn't, because it's *secret* knowledge, and I didn't want to tell you unless you REALLY wanted to know.
Seriously. I just told you, I used google to do the basic research you should have done, and confirmed there is nothing in .NET, no standard way to do this.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi all i have a code in to show Date to Date report.When i compile and run it, it cannt show any error but when it run in browser it takes too much time to load and no result is shown. I take this code from an article and i want to implement it. Plz help y it even show parameters and reports???
protected void btnShow_Click(object sender, System.EventArgs e)
{
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("CrystalReport3.rpt");
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
Tables CrTables;
ParameterFieldDefinitions crParameterFieldDefinitions ;
ParameterFieldDefinition crParameterFieldDefinition ;
ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();
crParameterDiscreteValue.Value =txtFrom.Text;
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions["Date1"];
crParameterValues = crParameterFieldDefinition.CurrentValues;
crParameterValues.Clear();
crParameterValues.Add(crParameterDiscreteValue);
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
crParameterDiscreteValue.Value = txtTo.Text;
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions["Date2"];
crParameterValues = crParameterFieldDefinition.CurrentValues;
crParameterValues.Add(crParameterDiscreteValue);
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
crConnectionInfo.ServerName = "Server1";
crConnectionInfo.DatabaseName = "Coupon Management.mdf";
crConnectionInfo.UserID = "";
crConnectionInfo.Password = "";
CrTables = cryRpt.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
CrystalReportViewer2.ReportSource = cryRpt;
CrystalReportViewer2.RefreshReport();
}
|
|
|
|
|
Do you have the vaguest idea what this code does ? Have you stepped through it to see where it gets stuck ? Are the values being passed in correct for your database, or did you just copy random code ? I am guessing you don't have a Coupon Management.mdf, or you have some other issue that's causing the database connection to time out, hence the wait.
Either way, programming and copying random code off the web, THEN asking us to make it work for you ( without even giving us the info we need to try to work out why it's not running ), are two different things. If you're being paid for the latter, you should tell your client you don't know what you're doing. If you're trying to learn, you shouldn't start with random code snippets, you should start with a book.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I have a class that takes a constrained generic type and I need to know whether that type will be boxed when I call the Equals method.
class FUBAR<T> where T : struct
{
bool DoSomething(T a, T b)
{
return a.Equals(b);
}
}
|
|
|
|
|
Use ildasm to check.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Why can't you just use the == operator ? How do they differ from each other ? Is that not possible because of the generic type ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Its not possible because structs do not implement the == operator implicitly.
|
|
|
|
|
Oh, of course. I was thinking of IComparable, but that has a CompareTo method, not ==. Generics in C# are woefully underpowered compared to C++. I don't think they are good for much more than containers of type T.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Boxing will happen for both byte and enum . This is because you have constrained only on struct and not all structs have got a strongly typed Equals() method. So a compiler will be forced to call the Equals(object obj) method defined in the System.Object which will lead into boxing.
To avoid boxing here, you can constraint on IEquatable<T> . But this will not allow you to specify a enum as enums don't have IEquatable implemented.
CaptainSeeSharp wrote: OR WILL THE OVERLOAD THAT BYTEDEFINES BE CALLED?
Call will go to byte's Equals(object obj) method as Object.Equals() is virtual and System.Byte has overridden it.
Best wishes,
Navaneeth
|
|
|
|
|
here i have code that i use with ZedGrapf:
for (int i = 0; i < 30; i++)
{
if (cene_novo[i] != "")
{
x = (double)new XDate(leto, mesec+i, i+14); ??
y1 = Convert.ToDouble(cene_novo[i]);
list1.Add(x, y1);
}
}
How to change month that starts from October 2008 for every i+2.. and end with october 2009?
|
|
|
|
|
Zedgraph have forums. They are the best place to ask questions about Zedgraph, because everyone who reads them, uses it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I have a problem. BIG one.
I have a LED connected to pin 3 and 5 at serial port (rs232).
Here is the code I make, who blink that led at an interval from a timer.
private SerialPort o_port = new SerialPort("COM3", 9600, Parity.Odd, 8, StopBits.One);
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
o_port.WriteLine("transmit data");
}
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
timer1.Interval = (int) numericUpDown1.Value;
labelInterval.Text = timer1.Interval.ToString();
}
What I want, is a modality to manipulate the ON state for the LED. In other words the sending data to pin 3.
I must link the "transmit data" to a timer event, and to keep it transmit for the duration of that timer event.
How to do that? hmmm.
Is there a special property who can be set to transmit a loop of data until some time is passed? Like flooding?
Thanks.
~Teodor~
modified on Sunday, November 1, 2009 6:41 PM
|
|
|
|
|
You could write a timer, then write a loop that sends the data over and over, and turn it off when the timer fires, if you send the data on another thread. That's assuming that the data gets sent once, that it's not a switch you turn on or off. That's how it worked when I worked with the serial port, you'd turn the pin on, set a timer, then turn it off again.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
well, when I integrate a while loop, my pc crash.
I really dont know how to do it...I dont have any clue. Please write me a code to have a inspiration on how to do it. Im a bit new to this .
thanks.
|
|
|
|
|
merlinq12 wrote: well, when I integrate a while loop, my pc crash.
How does it crash ? What happens ? What's the code ?
merlinq12 wrote: Please write me a code to have a inspiration on how to do it. Im a bit new to this Smile.
It's years since I did it, but have you tried just setting it once ? Does that turn the LED on, or make it flash on and off ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
private void timer1_Tick(object sender, EventArgs e)
{
int number = 1;
while (number == 1)
{
o_port.WriteLine("xxx");
}
}
The original code make the led flash/ ON and OFF.
I dont know how to turn the pin ON !!!!
|
|
|
|
|
I'd think you'd want to set a timer with a small interval, not run your processor to 100%.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
You have connected the LED between transmit data (TD) and ground (SG). Is is your intention to show when data is being transmitted or do you just want to turn an LED on and off?
If it's the latter then it would be better to connect the LED to one of the control lines, e.g. data terminal ready (DTR) or request to send (RTS), and ground. These lines can be toggled or or off via the SerialPort class.
The timer tick code would be e.g.
port.DtrEnable = !port.DtrEnable;
Alan.
|
|
|
|
|
Hi,
you're taking a bad approach here. The data lines (TD and RD) carry a serial data stream, which consists of start bits, data bits, parity bit, and stop bits; and by definition are not constant.
What you want can be achieved by using one of the control lines (that would be DTR or RTS, and it requires a hardware change to your current LED connection).
You can use SerialPort class, open the port, keep Handshake at None, then set DtrEnable or RtsEnable to the desired value. No need to read or write any data though.
BTW: don't forget to include a series resistor, 1K is a good first estimate.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
ohooohooo... Its Christmas time
Thank you very much for this very good advice, guys. Oau.
I use a usb to serial converter, and a bright LED , so I don't mind about the U/Led.
I wonder ... hmmm..I can run a stepper motor with this? Actually at this is serve the experiment with the led. Of course I will use a demultiplexor, a uln2004, and some bunch of wires.
If you know a better way (cleaner way) , I am all ears.
I have a pic 18f4550 but I dont have a scheme to make and then program it. I also have an 16f84 with what I do some nice stuff some time ago... with //port.
I also want to know how to make a timer run 1.25ms , then 1.50ms , then 1.75ms to be able to move a servo?
This would be great!!!!
|
|
|
|