|
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
|
|
|
|
|
how is it possible? would you please help me on this?
modified 13-Feb-19 21:02pm.
|
|
|
|
|
Please can anyone help with a project I'm working on. I'm trying to create a way of running an Azure message queue receiver in a permanently running background thread which immediately updates controls on a WPF page when a new message comes in. I've been playing with examples found on the web which download messages and display them in a console window but I'm struggling to work out how to pass the received messages over to a textbox control on an WPF page.
This is what I have been playing with which seems to work perfectly.....
namespace AzureMessagingReceiver
{
using System;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.ServiceBus;
class Program
{
const string ServiceBusConnectionString = "######.......";
const string QueueName = "#####......";
static IQueueClient queueClient;
static void Main(string[] args)
{
MainAsync().GetAwaiter().GetResult();
}
static async Task MainAsync()
{
queueClient = new QueueClient(ServiceBusConnectionString, QueueName);
Console.WriteLine("======================================================");
Console.WriteLine("Press ENTER key to exit after receiving all the messages.");
Console.WriteLine("======================================================");
RegisterOnMessageHandlerAndReceiveMessages();
Console.ReadKey();
await queueClient.CloseAsync();
}
static void RegisterOnMessageHandlerAndReceiveMessages()
{
var messageHandlerOptions = new MessageHandlerOptions(ExceptionReceivedHandler)
{
MaxConcurrentCalls = 1,
AutoComplete = false
};
queueClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions);
}
static async Task ProcessMessagesAsync(Message message, CancellationToken token)
{
Console.WriteLine($"Received message: SequenceNumber:{message.SystemProperties.SequenceNumber} Body:{Encoding.UTF8.GetString(message.Body)}");
await queueClient.CompleteAsync(message.SystemProperties.LockToken);
}
static Task ExceptionReceivedHandler(ExceptionReceivedEventArgs exceptionReceivedEventArgs)
{
Console.WriteLine($"Message handler encountered an exception {exceptionReceivedEventArgs.Exception}.");
var context = exceptionReceivedEventArgs.ExceptionReceivedContext;
Console.WriteLine("Exception context for troubleshooting:");
Console.WriteLine($"- Endpoint: {context.Endpoint}");
Console.WriteLine($"- Entity Path: {context.EntityPath}");
Console.WriteLine($"- Executing Action: {context.Action}");
return Task.CompletedTask;
}
}
}
.....just need help with how to turn this into what I need.
Any assistance greatly appreciated!
|
|
|
|
|
WPF relies heavily on INotifyPropertyChanged. You can use this to your advantage so that, when your data changes, you simply raise a PropertyChanged event.
This space for rent
|
|
|
|
|
1) Add messages received to a concurrent queue
2) When adding, start a "queue worker" if not already started
3) Queue worker dequeues messages and updates WPF window in progress reporting event
4) Queue worker runs until queue is empty,
or
1) Use a dispatcher timer to poll for new messages while updating WPF UI on same thread
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Hello All,
Using toggleClass and hasClass in javascript to toggle between 'SelectAll' and 'DeselectAll', to control the checkboxes. 'SelectAll' would check all the checkboxes, and 'DeselectAll' would deselect them all at once. This works fine in my development environment, but in staging server, the button does not invoke any action. It does nothing.
How does one go about debugging another environment, which does not have VS installed?
I have pasted a snippet - thank you!
script type="text/javascript">
$(function () {
$("#SelectAll").click(function () {
var $this = $(this);
$this.toggleClass('SelectAll');
if ($this.hasClass('SelectAll')) {
$this.text('DeselectAll');
$this.val('DeselectAll');
var ischecked = true;
} else {
$this.text('SelectAll');
$this.val('SelectAll');
var ischecked = false;
}
});
});
</script>
|
|
|
|
|
There is a subtle clue in that code as to why this is the wrong forum. It's hidden in two places; the first being that this forum is for C# and the second is in you code when it says javascript. You might have more luck if you don't just randomly pick a forum.
This space for rent
|
|
|
|
|
This is an MVC solution, but i shall post this in the javascript forum.
Thank you.
|
|
|
|
|
Lots of "magic words" ... Is this typical of javascript? Makes it harder to debug / cross-reference.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Gerry Schmitz wrote: Is this typical of javascript? JQuery. Modern JavaScript is bundled with 10Mb worth of libraries and dependencies
That's to make things easier, I been told
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
using Newtonsoft.Json;
using System;
using System.Windows.Forms;
using System.Xml;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(" <student>\r\n <student_name>Preethi\r\n <ssn>45679\r\n <course>Electronics and communication\r\n <address>\r\n <line_1>#1, 6th cross\r\n <line_2>Victoria Layout\r\n <city>Bangalore\r\n <country>India\r\n </address>\r\n \r\n");
string jsonText = JsonConvert.SerializeXmlNode(doc);
MessageBox.Show(jsonText);
}
}
}
|
|
|
|
|
XmlDocument.Load Method[^]
XmlDocument doc = new XmlDocument();
doc.Load(@"C:\Path\To\The\Xml\file.xml");
NB: You shouldn't try to put the whole question in the "subject" box. Instead, put a brief summary of the question as the subject, and type the detail of the question in the "message" box.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That XML is malformed. It seems you're missing closing tags all over the place.
<student>
<student_name>Preethi</student_name>
<ssn>45679</ssn>
<course>Electronics and communication</course>
<address>
<line_1>#1, 6th cross</line_1>
<line_2>Victoria Layout</line_2>
<city>Bangalore</city>
<country>India</country>
</address>
</student>
|
|
|
|
|
hello
right now i have a program class
have this list
List<order> lsor = new List<order>();
i want to access list lsor from another class
|
|
|
|