|
Please edit your original post, and update it, rather than post more.
And, what is the problem now . What works, what does not work ?
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
Quite a lot wrong with your code:
private void KonverterBTN_Click(object sender, EventArgs e)
{
Celsiuslistbox.Items.Add(textBox1);
double temp_Celsius;
double temp_Fahrenheit;
int count;
for ( count = 0; count <10; count++)
{
temp_Celsius = Celsiuslistbox.Items.Add(textBox1.Text);
}
do
{
temp_Celsius = Celsiuslistbox.Items.Add(textBox1.Text);
} while ( count <=10);
temp_Fahrenheit = (9.0 / 5.0) * temp_Celsius + 32;
FahrenheitListBox.Items.Add(temp_Fahrenheit);
|
|
|
|
|
If all the user does is enter "Celcius", then you can just make the F and K values "calculated columns" in a listbox / view / grid (Don't need "multiple listboxes").
More satisfying is creating a "temperature object" that can except a given value and scale and return a corresponding value in any other scale.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I am building a database application which require some security with biometric prints. How to add the function to find records after scanning the print via the biometric machine?
|
|
|
|
|
Start with the biometric reader manufacturer's website: they will normally have sample code which demonstrates a basic "how to use it" app. Once you have that working, it should be fairly obvious what you need to do to get your app version working.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
In order to "find" something, you need "keys / data".
Find out what "data" is being captured (and stored) with the "biometric prints".
Find out if there are other data generation / collection options for the "biometric machine".
Document the old physical and old logical.
Then create your new logical and new physical models.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I have an integerExponentiate() function that operates on two objects of like type, and relies only on the fact that the type implements the * operator and has an instance that represents the mathematical concept of a unit. I have several classes that meet those criteria, and would like it to be possible for integerExponentiate() to be called on instances of any of those classes. My first thought was to make integerExponentiate() a generic method that takes the unit and a delegate representing the multiplication operator as parameters, something like this:
delegate T multiplier<T>(T a, T b);
T integerExponentiate<T>(multiplier<T> m, T unit, T expBase, Integer exponent);
But I don't see a way to assign an operator to a delegate. Is there a way to do that directly, or do I have to wrap the operator in another function and use that? Or should I consider another approach entirely?
|
|
|
|
|
Solved it, I think: instead of cluttering up the classes in question with a do-nothing multiply() function, I can pass an anonymous function for the m parameter of integerExponentiate(). I hadn't used anonymous functions before.
|
|
|
|
|
See if this givs you some ideas:
public static class GenericMathExtensions
{
public static double? Exp<T>(this T tvalue, double topower)
where T :
struct,
IComparable,
IComparable<T>,
IConvertible,
IEquatable<T>,
IFormattable
{
if (typeof(T).IsNumeric())
{
try
{
return Math.Pow(Convert.ToDouble(tvalue), topower);
}
catch
{
}
}
return null;
}
public static bool IsNumeric(this Type type)
{
switch (Type.GetTypeCode(type))
{
case TypeCode.Byte:
case TypeCode.SByte:
case TypeCode.UInt16:
case TypeCode.UInt32:
case TypeCode.UInt64:
case TypeCode.Int16:
case TypeCode.Int32:
case TypeCode.Int64:
case TypeCode.Decimal:
case TypeCode.Double:
case TypeCode.Single:
return true;
case TypeCode.Object:
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
{
return Nullable.GetUnderlyingType(type).IsNumeric();
}
return false;
default:
return false;
}
}
} Note: the Convert.ToDouble method can handle other types than those this code restricts the usage to.
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
Message Removed
modified 20-Mar-18 12:21pm.
|
|
|
|
|
i cant find a solution to create a chat application without the need to a server
all the project and idea i found are all based on a server and client
how can be done with just client in each pc and the clients are in the same local network so they need to discover each other IP and send the message to each other
|
|
|
|
|
The simple solution is to have an app that acts as both client and server.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
Do you know how to create an application which has a Server an a Client ?
In this case see my description - if not use Google to find some Examples and look how they work and try to understand the functionality.
|
|
|
|
|
Use the code you have found as a basis: start your app as a client, and look for an appropriate server. If you find one, connect to it and chat away.
If you don't, close the client, and open a server. The server then waits for another app to connect.
Or, start as a server, then open a client as well and search for other servers.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Additional to the answer of OriginalGriff :
The communication allways needs a Server (and could have one or more Clients).
So you could do the following :
You start your application as Client and try to connect a Server (I would use the synchronous methods here). If you don't get a response after a time (defined by you) there is no Server availible and perhaps your must be the Server (or you are not connected to a network ???) - so you switch to different methods (and tasks) in your application.
|
|
|
|
|
Have a look at SignalR
SignalR | Microsoft Docs
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Read up on the SNMP protocal, or automation of "net send" or "msg command"
Director of Transmogrification Services
Shinobi of Query Language
Master of Yoda Conditional
|
|
|
|
|
hi!
string format = "ss";
DateTime now = DateTime.Now;
string s = now.ToString(format);
ComPort.Write(s.Substring(0, 1));
ComPort.Write(s.Substring(1, 1)); // Only this (last one) execute
want to send two strings of second for example "05" to comport, but receive only last statement, Help Please
currently using these statements within timer tick
|
|
|
|
|
|
Hi Guys,
I would like to build a C#,Windows form application which will export all entries such as labels,textboxes,radio buttons to a pdf file. I am aware of itextsharp.dll and attached it to project as reference but couldn't archieve much.
I basically put 4 label/textbox and once I click button pdf will be generated at given path..
Is there anyone can advise me how to do?
Thank you.
modified 13-Feb-19 21:02pm.
|
|
|
|
|
The first thing you need to do is to decide what you want your PDF document to look like. Is it to be a simple document consisting of lines of text, or is it to be an image of your form? In either case you will need to use the various iTextSharp methods to create it. Some articles to get you started can be found at: codeproject: iTextsharp - Google Search[^].
|
|
|
|
|
Since you can do all this "manually", what parts do you want to automate?
1) create form with controls
2) print screen (with or without form active)
3) copy / crop in Paint
4) print to any PDF print driver
The 25 cent solution.
Otherwise, one needs to learn about "client areas" in Windows.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
hi I created form like below, goal is that all user inputs and form items should be on generated pdf.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace d1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}
modified 13-Feb-19 21:02pm.
|
|
|
|
|
If that's the best you can do for a response, then stick to "Print Screen".
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|