doolhofx
doolhofx
CC#
Created by doolhofx on 3/22/2024 in #help
Access my home device from outside the LAN network with me maui app
Hello! Maybe this isn't the right server for my question, but I am building a mobile and desktop app using C# .NET maui. It is for reading data from my Easy E4, it's a small PLC that I use at home. I want to read and write data to it from outside of my LAN network, without port forwarding. I think reverse proxy isn't an option, right? Because you need a proxy server in the LAN network, right? For extra info I am using Modbus TCP to read and write data from my app
34 replies
CC#
Created by doolhofx on 3/16/2024 in #help
Run code cyclical
Can anyone help me with running code cyclical? I have code that I want to execute every 10ms or 1 sec etc. And not just from an event, it needs to keep updating the code. Or just every cycle time I am mainly a PLC-programmer, don't know if C# also works with cyclic code execution the same as I am used to. C# 7.0, .NET Maui for android and windows
67 replies
CC#
Created by doolhofx on 10/12/2023 in #help
❔ Creating an e-mail concept using C#
Hello, I want to create an application that I can use to automatically create an e-mail concept with 1 variable attachment and some variable text. Now I have to create a mail, type address, text and add a PDF document every time. I want to automate that. So when I open the console application, I will in a number for example 12, and C# creates an e-mail concept for me with everywhere the number 12 where it should and add the attachment that is named 12 in the folder that I created for it. Anyone know what is a good library to use for that?
6 replies
CC#
Created by doolhofx on 5/30/2023 in #help
❔ Need help with Event Handlers to update a field.
I am making a unit conversion program in C# wpf as my first C# application. I have created a method that calculates the conversion from for example mm to m. It has 3 inputs, Input Unit - Output Unit - Input Value. Calculates the Output Value. I want to update the Output Value on 3 different events, InputWaarde_TextChanged or InputEenheid_SelectionChanged or OutputEenheid_SelectionChanged. But when I have the method in those event handlers I get the following error when I start the program and select a unit, both input or output or when I fill in a value.
System.NullReferenceException
System.Windows.Controls.Primitives.Selector.SelectedItem.get returned null.
System.NullReferenceException
System.Windows.Controls.Primitives.Selector.SelectedItem.get returned null.
Anyone has an idea on how to solve it? And is anyone willing to look at the rest of the code to give feedback? I think I can use some haha!
private void InputWaarde_TextChanged(object sender, TextChangedEventArgs e)
{
OutputWaarde.Text = Formules.Lengte(InputEenheid.SelectedItem.ToString(), OutputEenheid.SelectedItem.ToString(), InputWaarde.Text);

}

private void InputEenheid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
OutputWaarde.Text = Formules.Lengte(InputEenheid.SelectedItem.ToString(), OutputEenheid.SelectedItem.ToString(), InputWaarde.Text);

}

private void OutputEenheid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
OutputWaarde.Text = Formules.Lengte(InputEenheid.SelectedItem.ToString(), OutputEenheid.SelectedItem.ToString(), InputWaarde.Text);

}
private void InputWaarde_TextChanged(object sender, TextChangedEventArgs e)
{
OutputWaarde.Text = Formules.Lengte(InputEenheid.SelectedItem.ToString(), OutputEenheid.SelectedItem.ToString(), InputWaarde.Text);

}

private void InputEenheid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
OutputWaarde.Text = Formules.Lengte(InputEenheid.SelectedItem.ToString(), OutputEenheid.SelectedItem.ToString(), InputWaarde.Text);

}

private void OutputEenheid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
OutputWaarde.Text = Formules.Lengte(InputEenheid.SelectedItem.ToString(), OutputEenheid.SelectedItem.ToString(), InputWaarde.Text);

}
193 replies