C# System.NullReferenceException: 'Object reference not set to an instance of an object.'
HTML-код
- Опубликовано: 6 окт 2024
- For French, Swahili, and Lingala Tutoriels Contact us at:
stallonebininfo@gmail.com
+265 99 390 6365 On WhatsApp or a normal call
good job
Good explanation brother! Keep more !
Thank you, I will
Thanks
Ty
Can this work for xamarin application in Visual studio 2022?
Yes, even for Xamarin form
In xamarin, I have initialised the variables which are storing the data but still the same error after deployment of the app in the mobile
@@sayanabharati6548 Please try to put the breakpoint and run it to see where the error is coming from, or share with me that block of code
@@lumbochengebin
public partial class MainPage : ContentPage
{
private string gatewayIpAddress = string.Empty;
private string routerSSID = string.Empty;
private string routerPassword = string.Empty;
public MainPage()
{
InitializeComponent();
}
private async void ScanGatewayQR_Clicked(object sender, EventArgs e)
{
try
{
var scanner = new MobileBarcodeScanner();
var result = await scanner.Scan();
if (result != null && !string.IsNullOrEmpty(result.Text))
{
gatewayIpAddress = ExtractIpAddressFromQR(result.Text);
await DisplayAlert("Gateway QR Scanned", $"Gateway IP Address: {gatewayIpAddress}", "OK");
}
else
{
await DisplayAlert("Error", "Failed to scan Gateway QR code", "OK");
}
}
catch (Exception ex)
{
await DisplayAlert("Error", ex.Message, "OK");
}
}
private async void ScanRouterQR_Clicked(object sender, EventArgs e)
{
try
{
var scanner = new MobileBarcodeScanner();
var result = await scanner.Scan();
if (result != null && !string.IsNullOrEmpty(result.Text))
{
(routerSSID, routerPassword) = ExtractSSIDAndPasswordFromQR(result.Text);
await DisplayAlert("Router QR Scanned", "Scanned successfully!", "OK");
}
else
{
await DisplayAlert("Error", "Failed to scan Router QR code", "OK");
}
}
catch (Exception ex)
{
await DisplayAlert("Error", ex.Message, "OK");
}
}
what would I do if its a panel. "this.panel6.Controls.Add(this.Dev);"
share with me more details please
@@lumbochengebin this only happens with windows 11 computers and when ever my form starts it gives me an error and shows that