<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Forum Pasja Informatyki - C#</title>
<link>https://forum.pasja-informatyki.pl/questions/programowanie/c-sharp</link>
<description>Powered by Question2Answer</description>
<item>
<title>kłopot z symulacją pojazdów</title>
<link>https://forum.pasja-informatyki.pl/598468/klopot-z-symulacja-pojazdow</link>
<description>

&lt;pre class=&quot;brush:csharp;&quot;&gt;
DeliveryController:
        [HttpPost]
        public async Task&amp;lt;ActionResult&amp;lt;DeliveryDto&amp;gt;&amp;gt; CreateDelivery([FromBody] AddDeliveryDto dto)
        {
            var vehicle = await _context.Vehicles
                .Include(v =&amp;gt; v.Driver)
                .FirstOrDefaultAsync(v =&amp;gt; v.Id == dto.VehicleId);
            var driver = vehicle.Driver;
            double startLatitude = Math.Round(dto.StartLatitude, 6);
            double startLongitude = Math.Round(dto.StartLongitude, 6);
            double endLatitude = Math.Round(dto.EndLatitude, 6);
            double endLongitude = Math.Round(dto.EndLongitude, 6);
            var activeDelivery = await _context.Deliveries
                .FirstOrDefaultAsync(d =&amp;gt; d.VehicleId == dto.VehicleId &amp;amp;&amp;amp; d.Status == DeliveryStatus.InProgress);

            var delivery = new Delivery
            {
                VehicleId = dto.VehicleId,
                LoadDescription = dto.LoadDescription,
                StartLatitude = startLatitude,
                StartLongitude = startLongitude,
                EndLatitude = endLatitude,
                EndLongitude = endLongitude,
                Status = activeDelivery != null ? DeliveryStatus.Pending : DeliveryStatus.InProgress,
                CreatedAt = DateTime.UtcNow,
                CompletedAt = null,
                ClientName = dto.ClientName,
                ClientPhone = dto.ClientPhone,
                Order = orderToAssign
            };
            using var transaction = await _context.Database.BeginTransactionAsync();
            try
            {
                if (vehicle.Status == VehicleStatus.ReturningToBase)
                {
                    await _webSocketService.CancelSimulationAsync(vehicle.Id);
                }
                _context.Deliveries.Add(delivery);

                if (delivery.Status == DeliveryStatus.InProgress)
                {
                    vehicle.Status = VehicleStatus.OnTheRoad;
                    _context.Entry(vehicle).State = EntityState.Modified;
                }
                await _context.SaveChangesAsync();
                if (delivery.Status == DeliveryStatus.InProgress)
                {
                    List&amp;lt;(double lat, double lng)&amp;gt; routeToStart = await _routeService.GetRouteCoordinatesAsync(
                        vehicle.Longitude ?? 0.0,
                        vehicle.Latitude ?? 0.0,
                        startLongitude,
                        startLatitude);
                    List&amp;lt;(double lat, double lng)&amp;gt; routeToDestination = await _routeService.GetRouteCoordinatesAsync(
                        startLongitude,
                        startLatitude,
                        endLongitude,
                        endLatitude,
                        dto.SelectedRouteIndex);
                    // Uruchamiamy symulację dostawy
                    _ = _webSocketService.SimulateDeliveryAsync(dto.VehicleId, routeToStart, routeToDestination);
                }
                await transaction.CommitAsync();
                var deliveryDto = new DeliveryDto
                {
                    Id = delivery.Id,
                    VehicleId = delivery.VehicleId,
                    LoadDescription = delivery.LoadDescription,
                    StartLatitude = delivery.StartLatitude,
                    StartLongitude = delivery.StartLongitude,
                    EndLatitude = delivery.EndLatitude,
                    EndLongitude = delivery.EndLongitude,
                    Status = delivery.Status,
                    CreatedAt = delivery.CreatedAt,
                    ClientName = delivery.ClientName,
                    ClientPhone = delivery.ClientPhone
                };
            }

WebSocketService.cs:
public class WebSocketService
{
    private readonly IServiceScopeFactory _scopeFactory;
    private readonly ConfigService _configService;
    private readonly List&amp;lt;WebSocket&amp;gt; _sockets = new List&amp;lt;WebSocket&amp;gt;();
    private List&amp;lt;VehicleData&amp;gt; _cachedVehicles = new List&amp;lt;VehicleData&amp;gt;();
    private DateTime _lastCacheUpdate = DateTime.MinValue;
    private readonly RouteService _routeService;
    private readonly Dictionary&amp;lt;int, List&amp;lt;(Task task, CancellationTokenSource cancellationTokenSource)&amp;gt;&amp;gt; _simulationTasks = new();
    public async Task HandleWebSocketAsync(HttpContext context)
    {
        var socket = await context.WebSockets.AcceptWebSocketAsync();
        _sockets.Add(socket);
        try
        {
            while (socket.State == WebSocketState.Open)
            {
                using (var scope = _scopeFactory.CreateScope())
                {
                    var dbContext = scope.ServiceProvider.GetRequiredService&amp;lt;ApplicationDbContext&amp;gt;();

                    var vehicles = await dbContext.Vehicles
                        .Include(v =&amp;gt; v.Driver)
                        .ThenInclude(d =&amp;gt; d!.User)
                        .Select(v =&amp;gt; new VehicleData
                        {
                            Id = v.Id,
                            Status = v.Status,
                            Latitude = Math.Round(v.Latitude ?? 0.0, 6),
                            Longitude = Math.Round(v.Longitude ?? 0.0, 6),
                            RegistrationNumber = v.RegistrationNumber ?? &quot;&quot;,
                            Brand = v.Brand ?? &quot;&quot;,
                            Model = v.Model ?? &quot;&quot;,
                            YearOfProduction = v.YearOfProduction,
                            BodyworkType = v.BodyworkType,
                            Capacity = v.Capacity,
                            Type = (int)v.Type,
                            LastModified = v.LastModified,
                            DriverId = v.Driver != null ? v.Driver.Id : null,
                            DriverFirstName = v.Driver != null ? v.Driver.User!.FirstName : null,
                            DriverLastName = v.Driver != null ? v.Driver.User!.LastName : null,
                            DriverPhoneNumber = v.Driver != null ? v.Driver.User!.PhoneNumber : null,
                            Deliveries = v.Status == VehicleStatus.OnTheRoad &amp;amp;&amp;amp; v.Deliveries != null
                                ? v.Deliveries.Select(d =&amp;gt; new DeliveryData
                                {
                                    Id = d.Id,
                                    LoadDescription = d.LoadDescription,
                                    Status = (int)d.Status,
                                    StartLatitude = Math.Round(d.StartLatitude, 6),
                                    StartLongitude = Math.Round(d.StartLongitude, 6),
                                    EndLatitude = Math.Round(d.EndLatitude, 6),
                                    EndLongitude = Math.Round(d.EndLongitude, 6),
                                    CreatedAt = d.CreatedAt,
                                    CompletedAt = d.CompletedAt,
                                    ClientName = d.ClientName ?? string.Empty,
                                    ClientPhone = d.ClientPhone ?? string.Empty
                                }).ToList()
                                : new List&amp;lt;DeliveryData&amp;gt;(),
                            SemiTrailer = v.Type == VehicleType.SemiTrailerTruck &amp;amp;&amp;amp; v.SemiTrailerId.HasValue
                                ? dbContext.Vehicles.Where(s =&amp;gt; s.Id == v.SemiTrailerId.Value)
                                    .Select(s =&amp;gt; new SemiTrailerData
                                    {
                                        Id = s.Id,
                                        RegistrationNumber = s.RegistrationNumber ?? &quot;&quot;,
                                        Brand = s.Brand ?? &quot;&quot;,
                                        Model = s.Model ?? &quot;&quot;,
                                        YearOfProduction = s.YearOfProduction,
                                        BodyworkType = s.BodyworkType,
                                        Capacity = s.Capacity
                                    }).FirstOrDefault()
                                : null
                        })
                        .ToListAsync();

                    _cachedVehicles = vehicles;
                    _lastCacheUpdate = DateTime.UtcNow;
                }
                var json = JsonSerializer.Serialize(_cachedVehicles);
                var buffer = Encoding.UTF8.GetBytes(json);
                foreach (var client in _sockets)
                {
                    if (client.State == WebSocketState.Open)
                    {
                        await client.SendAsync(new ArraySegment&amp;lt;byte&amp;gt;(buffer),
                                               WebSocketMessageType.Text,
                                               true,
                                               CancellationToken.None);
                    }
                }
                await Task.Delay(3000); 
            }
        }
public async Task SimulateDeliveryAsync(int vehicleId, List&amp;lt;(double lat, double lng)&amp;gt; routeToStart, List&amp;lt;(double lat, double lng)&amp;gt; routeToDestination)
    {
        using var scope = _scopeFactory.CreateScope();
        var dbContext = scope.ServiceProvider.GetRequiredService&amp;lt;ApplicationDbContext&amp;gt;();
        var vehicle = await dbContext.Vehicles.FindAsync(vehicleId, CancellationToken.None);
        await SimulateRouteAsync(vehicleId, routeToStart, CancellationToken.None);
        await SimulateRouteAsync(vehicleId, routeToDestination, CancellationToken.None);
        var delivery = await dbContext.Deliveries
            .Where(d =&amp;gt; d.VehicleId == vehicleId &amp;amp;&amp;amp; d.Status == DeliveryStatus.InProgress)
            .FirstOrDefaultAsync(CancellationToken.None);
        if (delivery != null)
        {
            delivery.Status = DeliveryStatus.Completed;
            delivery.CompletedAt = DateTime.UtcNow;
            await dbContext.SaveChangesAsync();
            var activeNewOrder = await dbContext.Deliveries
                .Where(d =&amp;gt; d.VehicleId == vehicleId &amp;amp;&amp;amp; (d.Status == DeliveryStatus.Pending || d.Status == DeliveryStatus.InProgress))
                .FirstOrDefaultAsync();
            if (activeNewOrder == null)
            {
                vehicle.Status = VehicleStatus.ReturningToBase;
                await dbContext.SaveChangesAsync();
                await SimulateRouteToBaseAsync(vehicleId, CancellationToken.None);
            }
        }
    }
private async Task SimulateRouteAsync(int vehicleId, List&amp;lt;(double lat, double lng)&amp;gt; routeCoordinates, CancellationToken cancellationToken)
    {
        using var scope = _scopeFactory.CreateScope();
        var dbContext = scope.ServiceProvider.GetRequiredService&amp;lt;ApplicationDbContext&amp;gt;();
        foreach (var point in routeCoordinates)
        {
            cancellationToken.ThrowIfCancellationRequested();
            var vehicle = await dbContext.Vehicles.FindAsync(vehicleId, cancellationToken);
            if (vehicle != null)
            {
                vehicle.Latitude = Math.Round(point.lat, 6);
                vehicle.Longitude = Math.Round(point.lng, 6);
                vehicle.LastModified = DateTime.UtcNow;
                await dbContext.SaveChangesAsync(cancellationToken);
            }
            await Task.Delay(3000, cancellationToken);
        }
    }
public async Task SimulateRouteToBaseAsync(int vehicleId, CancellationToken cancellationToken)
    {
        using var scope = _scopeFactory.CreateScope();
        var dbContext = scope.ServiceProvider.GetRequiredService&amp;lt;ApplicationDbContext&amp;gt;();
        var vehicle = await dbContext.Vehicles.FindAsync(vehicleId, cancellationToken);

        var baseLocation = _configService.GetBaseLocation();
        List&amp;lt;(double lat, double lng)&amp;gt; routeToBase = await _routeService.GetRouteCoordinatesAsync(
            vehicle.Longitude ?? 0.0,
            vehicle.Latitude ?? 0.0,
            baseLocation.Longitude,
            baseLocation.Latitude);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
        //Nowy token dla symulacji powrotu do bazy
        var ctsBase = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
        var baseTask = Task.Run(async () =&amp;gt;
        {
            await SimulateRouteAsync(vehicleId, routeToBase, ctsBase.Token);
          });
        AddSimulationTask(vehicleId, baseTask, ctsBase);
        await baseTask;
    }
public async Task CancelSimulationAsync(int vehicleId)
    {
        if (_simulationTasks.ContainsKey(vehicleId))
        {
            var tasksForVehicle = _simulationTasks[vehicleId];
            foreach (var (task, cancellationTokenSource) in tasksForVehicle)
            {
                cancellationTokenSource.Cancel(); 
                try
                {
                    await task;
                }
                catch (TaskCanceledException)
                {
                    Console.WriteLine($&quot;Symulacja dla pojazdu {vehicleId} została anulowana.&quot;);
                }
            }
            _simulationTasks.Remove(vehicleId);
        }
    }
private void AddSimulationTask(int vehicleId, Task task, CancellationTokenSource cts)
    {
        if (!_simulationTasks.ContainsKey(vehicleId))
        {
            _simulationTasks[vehicleId] = new List&amp;lt;(Task, CancellationTokenSource)&amp;gt;();
        }
        _simulationTasks[vehicleId].Add((task, cts)); // Dodajemy tylko zadanie powrotu do bazy
    }
&lt;/pre&gt;



&lt;p&gt;
&lt;br&gt;
Witam. Któryś dzień rozwiązuję ten sam problem. Nie mogę sobie poradzić. Mam mapę i mam na niej pojazdy. Dodaję zlecenie dla pojazdu ((CreateDelivery w kodzie)- wysyłam go w trasę- w aplikacji wpisuję tu miejsce początkowe i miejsce docelowe)- wtedy on rusza z bazy do miejsca początkowego.Dociera do miejsca początkowego (np. Kraków Graniczna 15..., potem jedzie do miejsca docelowego (np. Warszawa Graniczna 20...). Po tym wszystkim wraca do bazy. Podczas tego powrotu do bazy mogę dodac mu kolejne zlecenie. Czyli znowu dodaje zlecenie (pojazd caly czas wraca do bazy). Dodaję to zlecenie (wpisuje znowu miejsce poczatkowe i docelowe)&amp;nbsp;i on jedzie mi z miejsca w którym jest do miejsca początkowego zlecenia które wpisałem podczas dodawania zlecenia. Dojeżdza do miejsca początkowego, potem z miejsca początkowego jedzie do docelowego. Dociera do docelowego- i wraca do bazy. I TERAZ JEŚLI DODAJĘ mu kolejne zlecenie (on caly czas wraca do bazy) to zamiast jechac do miejsca poczatkowego tego zlecenia które wpisłaem podczas dodawania zlecenia to jedzie mi DO BAZY (oraz wykonuje dziwne przeskoki, &quot;teleportacje&quot; zmierzając raz w stronę miejsca początkowego, raz w stronę bazy. A powinien jechac po prostu do miejsca początkowego). Wiem że temat jest skomplikowany ale nie wiem już gdzie szukać pomocy. Dziekuję bardzo za każdą wskazówkę&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/598468/klopot-z-symulacja-pojazdow</guid>
<pubDate>Sat, 12 Apr 2025 11:53:44 +0000</pubDate>
</item>
<item>
<title>Xamarin nauka</title>
<link>https://forum.pasja-informatyki.pl/597034/xamarin-nauka</link>
<description>MS oficjalnie zakończył wsparcie tego frameworka. Zastanawiam się czy jest sens uczyć się tej technologii. Z jednej strony znając na jakimś tam już poziomie środowisko .Net byłoby prościej wskoczyć na Xamarin, ale z drugiej skoro się to nie rozwija, a wręcz zostało ubite przez producenta to sam nie wiem czy warto.</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/597034/xamarin-nauka</guid>
<pubDate>Thu, 28 Nov 2024 09:43:38 +0000</pubDate>
</item>
<item>
<title>Gra w .Net Core - jakie rozwiązanie lepsze</title>
<link>https://forum.pasja-informatyki.pl/596756/gra-w-net-core-jakie-rozwiazanie-lepsze</link>
<description>Cześć&lt;br /&gt;
&lt;br /&gt;
Na wstępie zaznaczę, że jestem lajkiem w temacie i moje pytanie może być trochę chaotyczne, jednak mam nadzieję, że się domyślicie o co chodzi, jeśli zadam je niepoprawnie :D&lt;br /&gt;
&lt;br /&gt;
W ramach nauki platformy .Net oraz języka C#, planuję stworzyć grę via www i nurtuje mnie pytanie, czy jest jakaś większa różnica w wydajności przy dużym ruchu na serwerze pomiędzy .NET Core MVC (gdzie wszystkie widoki mam obsługiwane przez kontroler), a API którym tylko bym odpowiadał na zapytania z zewnętrznie utworzonej strony?&lt;br /&gt;
&lt;br /&gt;
Jeśli tak to jakie rozwiązanie byłoby najbardziej optymalne dla strony/gry z dużym natężeniem ruchu (liczbą graczy i podejmowanych przez nich akcji)?&lt;br /&gt;
&lt;br /&gt;
Dziękuję za odpowiedź.</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/596756/gra-w-net-core-jakie-rozwiazanie-lepsze</guid>
<pubDate>Thu, 14 Nov 2024 04:21:54 +0000</pubDate>
</item>
<item>
<title>Szukam lepszego TTS</title>
<link>https://forum.pasja-informatyki.pl/595145/szukam-lepszego-tts</link>
<description>Witam, pracuje nad pewnym projektem i obecnie używam System.Speech.Synthesis do odczytywania tekstu. Mamy 2024, mamy sztuczną inteligencje i zastanawiam się czy jest jakiś fajny TTS z głosem AI, który brzmi jak człowiek. Fajnie jakby dało radę użyć tego TTSa w C# i żeby działał offline, nawet jak nie ma dostępu do internetu. Interesuje mnie też żeby działał na windowsie. Może ktoś zna jakąś dobrą bibliotekę na githubie? I w miarę możliwości prostą w użyciu, tak jak to rozwiązanie od microsoftu, z którego teraz korzystam.</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/595145/szukam-lepszego-tts</guid>
<pubDate>Mon, 08 Jul 2024 21:14:05 +0000</pubDate>
</item>
<item>
<title>Nie generuje mi się PK(klucz główny)</title>
<link>https://forum.pasja-informatyki.pl/594387/nie-generuje-mi-sie-pk-klucz-glowny</link>
<description>

&lt;p&gt;Witam wszystkich, mam problem z generowniem klucza głównego. kompletnie nie wiem na czym polega błąd i jak go okiełznać.&amp;nbsp;
&lt;br&gt;
tutaj wstawiam część kodu odpowiedzialną za generowanie danych w bazie:
&lt;br&gt;
&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
 foreach (var item in cartDetail)
 {
     var orderDetail = new OrderDetail
     {
         CartDetailId = item.Id,
         OrderId = order.Id,
         Quantity = item.Quantity,
         UnitPrice = item.UnitPrice
     };
     await _db.OrderDetails.AddAsync(orderDetail);
                     
 }
    await _db.SaveChangesAsync();&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;Tak naprawde nie wiem jaka część kodu mam wstawić bo wszystkie dane sie uzupełniają ale brakuje automatycznego uzupełnienia PK dla tabeli OrderDetail. Działam na EntityFrameworkCore.
&lt;br&gt;
Z góry dzięki za pomoc.&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/594387/nie-generuje-mi-sie-pk-klucz-glowny</guid>
<pubDate>Wed, 05 Jun 2024 17:22:09 +0000</pubDate>
</item>
<item>
<title>MAUI / XAMARIN - Wyjątek w aplikacji podczas debugowania - nie pokazuje kodu.</title>
<link>https://forum.pasja-informatyki.pl/594309/maui-xamarin-wyjatek-w-aplikacji-podczas-debugowania-nie-pokazuje-kodu</link>
<description>

&lt;p&gt;Witam. Pisze aplikację na androida w c#, debuguję na fizycznym urządzeniu i mam błąd jak ze zdjęcia niżej po uruchomieniu jednej z funkcji (funkcja ma za zadanie sprawdzić nazwę aktualnej sieci wifi i aktualnego urządzenia bluetooth). Cały kod funkcji jest w try catch, mimo to wyrzuca mi unhandled exception. Dodatkowo nie pokazuje gdzie nastąpił błąd, tylko pisze &quot;there is no code to show&quot;, co w takiej sytuacji mogę zrobić jak nawet nie wiem gdzie jest błąd?
&lt;br&gt;

&lt;br&gt;
&lt;img alt=&quot;&quot; src=&quot;https://forum.pasja-informatyki.pl/?qa=blob&amp;amp;qa_blobid=15749560467879879692&quot; style=&quot;height:480px; width:560px&quot;&gt;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/594309/maui-xamarin-wyjatek-w-aplikacji-podczas-debugowania-nie-pokazuje-kodu</guid>
<pubDate>Sun, 02 Jun 2024 20:41:25 +0000</pubDate>
</item>
<item>
<title>Serializacja i deserializacja</title>
<link>https://forum.pasja-informatyki.pl/594083/serializacja-i-deserializacja</link>
<description>

&lt;p&gt;Błąd polega na tym, że zapisuje mi pustą tablicę:&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
saveFileDialog1.Filter = &quot;txt Files|*.txt|All Files|*.*&quot;;
if (MessageBox.Show(&quot;Czy chcesz zapisać wszystkie dane?&quot;,
   &quot;Zamykanie&quot;, MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
{
    try
    {
        saveFileDialog1.ShowDialog();
        foreach (Pracownik pracownik in Pracownik.Pracownicy)
        {
            using (StreamWriter fs = new StreamWriter(saveFileDialog1.FileName))
            {
                fs.Write(JsonSerializer.Serialize(pracownik));
               
            }
        }
    }&lt;/pre&gt;



&lt;p&gt;A tutaj jest błąd deserializacji:&amp;nbsp; &amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
    Pracownik.PrepareDGV(dataGridView1);
    refresh();
    if (MessageBox.Show(&quot;Czy chcesz załadować istniejące już dane?&quot;, &quot;Ładowanie&quot;,
       MessageBoxButtons.YesNo) == DialogResult.Yes)
    {
        try
        {
            openFileDialog1.ShowDialog();
            using (FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open))
            {
                List&amp;lt;Pracownik&amp;gt; pracownik = JsonSerializer.Deserialize&amp;lt;List&amp;lt;Pracownik&amp;gt;&amp;gt;(fs);
            }
            refresh();
        }
        catch (FileNotFoundException ex)
        {
            MessageBox.Show(&quot;Nie znaleziono pliku: &quot; + ex.Message, &quot;Błąd ładowania&quot;,
            MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        catch (JsonException ex)
        {
            MessageBox.Show(&quot;Błąd deserializacji danych: &quot; + ex.Message,
            &quot;Błąd ładowania&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        catch (Exception ex)
        {
            MessageBox.Show(&quot;Wystąpił nieoczekiwany błąd: &quot; + ex.Message,
            &quot;Błąd&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
}
void refresh()
{
    dataGridView1.Rows.Clear();

    foreach (Pracownik p in Pracownik.Pracownicy)
    {
        int index = dataGridView1.Rows.Add(p.tbl);
        dataGridView1.Rows[index].Tag = p;
    }




}&lt;/pre&gt;



&lt;p&gt;Proszę o szybką odpowiedź&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/594083/serializacja-i-deserializacja</guid>
<pubDate>Sat, 25 May 2024 11:50:42 +0000</pubDate>
</item>
<item>
<title>Przycisk button1_click w Form1.cs, należność wyświetla się jako 0,00.</title>
<link>https://forum.pasja-informatyki.pl/594079/przycisk-button1_click-w-form1-cs-naleznosc-wyswietla-sie-jako-0-00</link>
<description>

&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System.Text;
using System.Windows.Forms;
using Projekt___serwis_samochodowy_u_pana_Zenka;



namespace Projekt___serwis_samochodowy_pana_Zenka
{
    public partial class Form1 : Form
    {
        List&amp;lt;Pracownik&amp;gt; Mechanicy = new List&amp;lt;Pracownik&amp;gt;();
        List&amp;lt;Samochod&amp;gt; Auta = new List&amp;lt;Samochod&amp;gt;();

        Pracownik pracownik;
        public Form1()
        {
            InitializeComponent();
            pracownik = new Pracownik();
        }

        private void pracownicyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            (new FormPracownicy()).ShowDialog();
        }

        private void naprawioneSamochodyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            (new FormNaprawioneSamochody()).ShowDialog();
        }

        private void button1_Click(object sender, EventArgs e)
        {


            decimal[] należność_dla_mechaników = new decimal[Pracownik.Pracownicy.Count];

            foreach (Samochod samochod in Auta)
            {
                int nr_mechanika = Pracownik.Pracownicy.IndexOf(samochod.Pracownik);
                należność_dla_mechaników[nr_mechanika] += samochod.Należność;
            }

            dataGridView1.Rows.Clear();

            foreach (Pracownik pracownik in Pracownik.Pracownicy)
            {
                dataGridView1.Rows.Add(new object[] {
                    pracownik.ToString(),
                    należność_dla_mechaników[Pracownik.Pracownicy.IndexOf(pracownik)].ToString(&quot;0.00&quot;)

                });
            }



        }



        
    }
}

&lt;/pre&gt;



&lt;p&gt;Na górze plik Form1.cs&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
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;
using Projekt___serwis_samochodowy_pana_Zenka;

namespace WinFormsApp1
{
    public partial class FormDodajPracownika : Form
    {
        Pracownik pracownik;

        internal FormDodajPracownika(Pracownik książka)
        {
            InitializeComponent();
            this.pracownik = książka;
        }


        private void FormKsiążka_Load(object sender, EventArgs e)
        {
            textBox_imie.Text = pracownik.Imie;
            textBox_nazwisko.Text = pracownik.Nazwisko;
            textBox_rok.Text = pracownik.Rok_rozpoczecia_pracy;
            numericUpDown_stawkaZaGodzine.Value = pracownik.Stawka_za_godzine_pracy;
        }

       
        private void buttonOK_Click(object sender, EventArgs e)
        {
            pracownik.Imie = textBox_imie.Text;
            pracownik.Nazwisko = textBox_nazwisko.Text;
            pracownik.Rok_rozpoczecia_pracy = textBox_rok.Text;
            pracownik.Stawka_za_godzine_pracy = numericUpDown_stawkaZaGodzine.Value;
        }
    }
}
&lt;/pre&gt;



&lt;p&gt;Plik FormDodajPracownika.cs&amp;nbsp;&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
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;
using Projekt___serwis_samochodowy_pana_Zenka;

namespace Projekt___serwis_samochodowy_u_pana_Zenka
{
    public partial class FormNaprawioneSamochody : Form
    {
        public FormNaprawioneSamochody()
        {
            InitializeComponent();
        }

        private void FormNaprawioneSamochody_Load(object sender, EventArgs e)
        {
            Samochod.PrepareDGV(dataGridView_samochody);
            refresh();
        }

        void refresh()
        {
            dataGridView_samochody.Rows.Clear();

            foreach (Samochod s in Samochod.samochody)
            {
                int index = dataGridView_samochody.Rows.Add(s.toObtbl);
                dataGridView_samochody.Rows[index].Tag = s;
            }
        }





        private void edytujToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (dataGridView_samochody.SelectedRows.Count &amp;lt; 1)
                return;

            int index = dataGridView_samochody.Rows.IndexOf(dataGridView_samochody.SelectedRows[0]);


            Samochod punktDoEdycji = (Samochod)dataGridView_samochody.SelectedRows[0].Tag;
            FormSamochody form = new FormSamochody(punktDoEdycji);
            form.ShowDialog();
           

            dataGridView_samochody.Rows[index].Selected = true;
           
            refresh();
        }

        private void dataGridView_samochody_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void dodajToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var nowy_samochod = new Samochod();
            FormSamochody form = new FormSamochody(nowy_samochod);
            DialogResult result = form.ShowDialog();

            if (result != DialogResult.OK)
            {
                return;
            }


            Samochod.samochody.Add(nowy_samochod);
            refresh();
        }

        private void usuńToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridView_samochody .SelectedRows.Count &amp;lt; 1)
                return;


            Samochod DoUsunięcia = (Samochod)dataGridView_samochody.SelectedRows[0].Tag;

            DialogResult result = MessageBox.Show
                (&quot;Czy na pewno usunąć rekord z listy?&quot;, &quot;potwierdzenie&quot;
                , MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (result != DialogResult.OK)
                return;


            Samochod.samochody.Remove(DoUsunięcia);

            refresh();
        }
    }
}
&lt;/pre&gt;



&lt;p&gt;FormNaprawioneSamochody.cs&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using System.Windows.Forms;
using WinFormsApp1;

namespace Projekt___serwis_samochodowy_pana_Zenka
{
&amp;nbsp; &amp;nbsp; public partial class FormPracownicy : Form
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;Pracownik&amp;gt; Mechanicy = new List&amp;lt;Pracownik&amp;gt;();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public FormPracownicy()
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InitializeComponent();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private void wyswietl_mechanikow()
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dataGridView1.Rows.Clear();

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (Pracownik pracownik in Mechanicy)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dataGridView1.Rows.Add(pracownik);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private void FormPracownicy_Load(object sender, EventArgs e)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pracownik.PrepareDGV(dataGridView1);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refresh();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (MessageBox.Show(&quot;Czy chcesz załadować istniejące już dane?&quot;, &quot;Ładowanie&quot;,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MessageBoxButtons.YesNo) == DialogResult.Yes)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; openFileDialog1.ShowDialog();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open))
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;Pracownik&amp;gt; Mechanicy = JsonSerializer.Deserialize&amp;lt;List&amp;lt;Pracownik&amp;gt;&amp;gt;(fs);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refresh();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (FileNotFoundException ex)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(&quot;Nie znaleziono pliku: &quot; + ex.Message, &quot;Błąd ładowania&quot;,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBoxButtons.OK, MessageBoxIcon.Error);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (JsonException ex)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(&quot;Błąd deserializacji danych: &quot; + ex.Message,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Błąd ładowania&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception ex)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(&quot;Wystąpił nieoczekiwany błąd: &quot; + ex.Message,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Błąd&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; void refresh()
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dataGridView1.Rows.Clear();

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (Pracownik p in Pracownik.Pracownicy)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int index = dataGridView1.Rows.Add(p.tbl);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dataGridView1.Rows[index].Tag = p;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }


&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private void dodajToolStripMenuItem_Click(object sender, EventArgs e)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var nowyPracownik = new Pracownik();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FormDodajPracownika form = new FormDodajPracownika(nowyPracownik);

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DialogResult result = form.ShowDialog();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (result != DialogResult.OK)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pracownik.Pracownicy.Add(nowyPracownik);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refresh();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private void usuńToolStripMenuItem_Click(object sender, EventArgs e)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (dataGridView1.SelectedRows.Count &amp;lt; 1)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;


&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pracownik DoUsunięcia = (Pracownik)dataGridView1.SelectedRows[0].Tag;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DialogResult result = MessageBox.Show
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (&quot;Czy na pewno usunąć rekord z listy?&quot;, &quot;potwierdzenie&quot;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (result != DialogResult.OK)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;


&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pracownik.Pracownicy.Remove(DoUsunięcia);

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refresh();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private void Form_closing(object sender, FormClosingEventArgs e)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (MessageBox.Show(&quot;Czy chcesz zapisać wszystkie dane?&quot;,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;Zamykanie&quot;, MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; saveFileDialog1.ShowDialog();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (StreamWriter fs = new StreamWriter(saveFileDialog1.FileName))
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fs.Write(JsonSerializer.Serialize(Mechanicy));
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wyswietl_mechanikow();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (IOException ex)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(&quot;Wystąpił błąd podczas zapisywania pliku: &quot; + ex.Message,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Błąd zapisu&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception ex)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(&quot;Wystąpił nieoczekiwany błąd: &quot; + ex.Message,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Błąd&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; }
}&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;W Form1.cs wyświetla się w datagridview imie i nazwisko mechanika, ale nie wykonuje obliczeń bądź ich nie widzi, ponieważ jako należność wyświetla się 0,00. Bardzo proszę o pomoc to jest c# windows forms, mam nadzieję że uda się coś znaleźć. Z góry dziękuję za jakąkolwiek pomoc. &lt;strong&gt;Reszta plików w komentarzach&lt;/strong&gt;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/594079/przycisk-button1_click-w-form1-cs-naleznosc-wyswietla-sie-jako-0-00</guid>
<pubDate>Sat, 25 May 2024 08:22:58 +0000</pubDate>
</item>
<item>
<title>Problem z uruchomieniem pliku exe</title>
<link>https://forum.pasja-informatyki.pl/593637/problem-z-uruchomieniem-pliku-exe</link>
<description>Cześć, mam nieco nietypowe pytanie. Piszę aktualnie program w C# Visual Studio na .NET Framework i nie wiem jak uruchomić inny plik .exe z zasobów programu (Properties.Resources.aplikacja.exe). Byłbym bardzo wdzięczny za pomoc.</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/593637/problem-z-uruchomieniem-pliku-exe</guid>
<pubDate>Fri, 10 May 2024 19:38:59 +0000</pubDate>
</item>
<item>
<title>C# Korzystanie ze wzorców, a łączenie np z Win Form</title>
<link>https://forum.pasja-informatyki.pl/593496/c%23-korzystanie-ze-wzorcow-a-laczenie-np-z-win-form</link>
<description>

&lt;p&gt;Witajcie&lt;/p&gt;



&lt;p&gt;Ćwiczę wzorce projektowe, ale mam problem z tematem, którego zapewne nie rozumiem. W poniższym przykładzie metody wytwórczej mamy banalne tworzenie różnych typów czekolady. I teraz (rozumiem enkapsulację) metody każdej klasy są tworzone jakby w zamkniętym obiekcie, a co jeśli chciałbym w metodzie np. &lt;strong&gt;void dodajeMleko()&lt;/strong&gt; podać parametr z winform np. comboboxa czyli &lt;strong&gt;void dodajeMleko(sojowe)&lt;/strong&gt;? W teorii nie mogę, ponieważ mamy możliwość w kodzie klienta wywołanie producenta i podane jaką czekoladę&amp;nbsp;ma nam przygotować z wewn. składników, a nie z naszych składników, które chcielibyśmy wskazać. Czy istnieje jakiś wzorzec który łączy poniższy przykład z interakcją użytkownika?&amp;nbsp;Z góry dzięki za pomoc&lt;/p&gt;



&lt;p&gt;Kod:&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication5
{
/* nasz uogolniony produkt */
abstract class Czekolada {
 
protected String about;
 
public abstract Czekolada dawajCzekolade();
 
protected void dodajeKakao(){
Console.WriteLine(&quot;Dodaje kakao...&quot;);
}
}
 
/* bardziej konkretny produkt  #1*/
class Mleczna : Czekolada {
public Mleczna(){
about = &quot;Mleczna&quot;;
}
 
public void dodajeMleko(){
Console.WriteLine(&quot;Dodaje mleko...&quot;);
}
 
public void dodajeCukier(){
Console.WriteLine(&quot;Dodaje cukier...&quot;);
}
 
public override Czekolada dawajCzekolade(){
Console.WriteLine(about);
dodajeKakao();
dodajeCukier();
dodajeMleko();
return this;
}
}
 
/* bardziej konkretny produkt  #2*/
class ZOrzechamiIBakaliami : Czekolada{
public ZOrzechamiIBakaliami(){
about = &quot;Z orzechami i bakaliami&quot;;
}
 
public void dodajeOrzechy(){
Console.WriteLine(&quot;Dodaje orzechy...&quot;);
}
 
public void dodajeBakalie(){
Console.WriteLine(&quot;Dodaje bakalie...&quot;);
}
 
public void dodajeCukier(){
Console.WriteLine(&quot;Dodaje cukier...&quot;);
}
 
public override Czekolada dawajCzekolade(){
Console.WriteLine(about);
dodajeKakao();
dodajeCukier();
dodajeOrzechy();
dodajeBakalie();
return this;
}
}
 
/* bardziej konkretny produkt  #3*/
class Gorzka : Czekolada {
public Gorzka(){
about = &quot;Gorzka&quot;;
}
 
public void dodajeEkstratWaniliowy(){
Console.WriteLine(&quot;Dodaje ekstrat waniliowy...&quot;);
}
 
public override Czekolada dawajCzekolade(){
Console.WriteLine(about);
dodajeKakao();
dodajeEkstratWaniliowy();
return this;
}
}
 
/* nasz stworca */
class ProducentCzekolady
{
public Czekolada produkcjaCzekolady(String about)
{
Czekolada czekolada = null;
 
/* teraz decyduje o tym, ktora czekolade wytworzy */
if (about.Equals(&quot;Mleczna&quot;))
{
czekolada = new Mleczna();
}
else if (about.Equals(&quot;Z orzechami i bakaliami&quot;))
{
czekolada = new ZOrzechamiIBakaliami();
}
else if (about.Equals(&quot;Gorzka&quot;))
{
czekolada = new Gorzka();
}
return czekolada.dawajCzekolade();
}
}
 
class Program
{
static void Main(string[] args)
{
ProducentCzekolady producent = new ProducentCzekolady();
Czekolada[] tab = new Czekolada[3];
 
tab[0] = producent.produkcjaCzekolady(&quot;Gorzka&quot;);
Console.WriteLine(&quot;--------------------------------------------------------------&quot;);
tab[1] = producent.produkcjaCzekolady(&quot;Z orzechami i bakaliami&quot;);
Console.WriteLine(&quot;--------------------------------------------------------------&quot;);
tab[2] = producent.produkcjaCzekolady(&quot;Mleczna&quot;);
Console.ReadLine();
}
}
}&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;http://www.algorytm.org/wzorce-projektowe/metoda-wytworcza-factory-method/factory-method-cs.html&quot;&gt;http://www.algorytm.org/wzorce-projektowe/metoda-wytworcza-factory-method/factory-method-cs.html&lt;/a&gt;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/593496/c%23-korzystanie-ze-wzorcow-a-laczenie-np-z-win-form</guid>
<pubDate>Fri, 03 May 2024 12:57:55 +0000</pubDate>
</item>
<item>
<title>C# kopiowanie tekstu ze strony literat.ug.edu.pl , wyrażenia regularne</title>
<link>https://forum.pasja-informatyki.pl/593486/c%23-kopiowanie-tekstu-ze-strony-literat-ug-edu-pl-wyrazenia-regularne</link>
<description>

&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.IO;
using System.Net;
using System.Threading;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
&amp;nbsp;
namespace ConsoleApplication1
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;class Program
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public static void Main(string[] args)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string outputpath = Console.ReadLine();
            using(StreamWriter  sw = new StreamWriter(outputpath))
            {
            string inputpathstart = &quot;https://literat.ug.edu.pl/faraon/&quot;;
            string inputpath;
            int noofchapters = 0;
            inputpath = inputpathstart + String.Empty;
            try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
				WebRequest request = HttpWebRequest.Create(inputpath);  
				WebResponse response = request.GetResponse();  
				System.Text.Encoding enc = System.Text.Encoding.GetEncoding (&quot;iso-8859-2&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;using(StreamReader sr = new StreamReader(response.GetResponseStream(),enc))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String text = sr.ReadToEnd(); 
					while(text.Contains((noofchapters+1).ToString(&quot;D3&quot;)+&quot;.htm&quot;))
						noofchapters++;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch (Exception e)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(&quot;The file could not be read&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(e.Message);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
			Console.WriteLine(&quot;{0} &quot;,noofchapters);
            for(int i=1;i&amp;lt;=noofchapters;i++)
            {
				inputpath  = inputpathstart + i.ToString(&quot;D3&quot;)+&quot;.htm&quot;;  
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
				WebRequest request = HttpWebRequest.Create(inputpath);  
				WebResponse response = request.GetResponse();  
				System.Text.Encoding enc = System.Text.Encoding.GetEncoding (&quot;iso-8859-2&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;using(StreamReader sr = new StreamReader(response.GetResponseStream(),enc))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String text = sr.ReadToEnd();
					text = System.Web.HttpUtility.HtmlDecode(text);
					text = RemoveHTMLTagsCompiled(text);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sw.WriteLine(text);
					sw.WriteLine();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch (Exception e)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(&quot;The file could not be read&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(e.Message);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
			}
		}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(&quot;Press Enter to exit&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.ReadKey();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;
		public static string RemoveHTMLTagsCompiled(string html)
		{
			string s;
			Regex htmlRegex = new Regex(&quot;&amp;lt;.*?&amp;gt;&quot;, RegexOptions.Compiled);
			s = htmlRegex.Replace(html, string.Empty);
			return s;
		}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
}

&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;Tutaj nie wiem czemu w pliku wynikowym znajduje się&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;blockquote&gt;


&lt;p&gt;&amp;lt;meta name=&quot;Keywords&quot;
&lt;br&gt;
content=&quot;Prus, Bolesław Prus, Głowacki, Aleksander Głowacki, Faraon, powieść, powieść polska, roman, polish roman, literary masterpiece, kultura polska, polish culture, Polska, Poland&quot;&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;Dlaczego funkcja z wyrażeniem regularnym go nie usunęła&lt;/p&gt;



&lt;p&gt;Przeczytajcie kod który podałem , przetestujcie go i zaproponujcie poprawkę&lt;/p&gt;



&lt;p&gt;Dodatkowo przydałoby się ten tekst jeszcze bardziej obrobić tak aby można było&lt;/p&gt;



&lt;p&gt;dać go na wejście do programu obsługującego TTS Paulina&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/593486/c%23-kopiowanie-tekstu-ze-strony-literat-ug-edu-pl-wyrazenia-regularne</guid>
<pubDate>Fri, 03 May 2024 06:23:00 +0000</pubDate>
</item>
<item>
<title>Korzystał ktoś z was kiedys z jakiegoś obfuscatora pod .NET?</title>
<link>https://forum.pasja-informatyki.pl/593029/korzystal-ktos-z-was-kiedys-z-jakiegos-obfuscatora-pod-net</link>
<description>Tak jak w temacie. Ktoś moze z was kiedys korzystał z jakiegoś obfuscatora pod .NET? Jeśli tak, z jakiego?</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/593029/korzystal-ktos-z-was-kiedys-z-jakiegos-obfuscatora-pod-net</guid>
<pubDate>Mon, 15 Apr 2024 21:35:09 +0000</pubDate>
</item>
<item>
<title>Automatyczny reconnect po utracie połączenia z WS w aplikacji C#</title>
<link>https://forum.pasja-informatyki.pl/592806/automatyczny-reconnect-po-utracie-polaczenia-z-ws-w-aplikacji-c%23</link>
<description>Witam, mam juz gotowe połaczenie z WS (apka .NET 8), lecz gdy serwer WS jest np. ponownie uruchamiany, klient traci połączenie z WS. Kompletnie nie wiem jak to zrobić, aby klient probował ponownie łączyć się z serwerem po zerwaniu połączenia. Probowalem to zrobić metodami ping/pong. Próba była również przy użyciu ifa z WebSocketMessageType.Close, natomiast if nigdy nie był wykonywany z jakiegoś powodu (result.MessageType == WebSocketMessageType.Close).&lt;br /&gt;
&lt;br /&gt;
Ktos mógłby mi coś doradzić? Całego kodu źródłego od razu mowie ze nie wysle, poniweaz aplikacja zawiera kilka ważnych funkcji związanych z kryptografia, dalej chyba nie musze tłumaczyć, prawda?</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/592806/automatyczny-reconnect-po-utracie-polaczenia-z-ws-w-aplikacji-c%23</guid>
<pubDate>Thu, 11 Apr 2024 18:18:53 +0000</pubDate>
</item>
<item>
<title>Czyszczenie jednej grupy textbox za jednym zamachem ?</title>
<link>https://forum.pasja-informatyki.pl/592727/czyszczenie-jednej-grupy-textbox-za-jednym-zamachem</link>
<description>

&lt;p&gt;Witam! Kiedyś to znalazłem teraz nie mogę. Potrzebuje pod WPF znaleźć polecenie które wyczyści części &quot;textboxów&quot;. Tylko te których nazwa zaczyna się od tbDane
&lt;br&gt;
Żeby np. nie pisać:&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
{
tbDaneA1.Clear(); tbDaneB1.Clear(); tbDaneC1.Clear(); tbDaneAD1.Clear();
}&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/592727/czyszczenie-jednej-grupy-textbox-za-jednym-zamachem</guid>
<pubDate>Wed, 10 Apr 2024 10:58:51 +0000</pubDate>
</item>
<item>
<title>Jak spakować do jednego pliku *.exe?</title>
<link>https://forum.pasja-informatyki.pl/592496/jak-spakowac-do-jednego-pliku-exe</link>
<description>Witam, przy produkcji mojego programu na .NET Framework w Visual Studio pojawił się problem. Program jest prymitywny, lecz po kompilacji dostałem aż 5 plików. Do działania programu potrzebne są trzy, o rozszerzeniach *.json, *.dll i *.exe Czy da się w jakiś sposób &amp;quot;spakować&amp;quot; to do jednego pliku *.exe? Bardzo dziękuję za pomoc</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/592496/jak-spakowac-do-jednego-pliku-exe</guid>
<pubDate>Sun, 31 Mar 2024 17:30:46 +0000</pubDate>
</item>
<item>
<title>2 Radiobutton i combobox ?</title>
<link>https://forum.pasja-informatyki.pl/592329/2-radiobutton-i-combobox</link>
<description>

&lt;p&gt;Mam combobox'a i dwa radiobutton'y. W combobox mam kolekcję (0,1,2,3). Domyślnie mam zaznaczony radiobutton1 oraz wybraną wartość domyślną 0 (index = 0). Gdy wybiaram radiobutton2 wskakuje mi domyślnie wartość 2 (index = 1). I to jest OK, ale co zrobić żeby przy wyborze radiobutton2 nie było możliwości wybrania 0 tylko (1,2,3). Ale żeby przy radiobutton1 była możliwość wybrania w combobox zera (0,1,2,3).&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
   public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            radioButton1.Checked = true;
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            comboBox1.SelectedIndex = 0;           
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            comboBox1.SelectedIndex = 1;
            comboBox1.Enabled = true;
        }
    }
}&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/592329/2-radiobutton-i-combobox</guid>
<pubDate>Thu, 21 Mar 2024 10:40:31 +0000</pubDate>
</item>
<item>
<title>Brak możliwości nadpisania tymczasowego zdjęcia w programie C#</title>
<link>https://forum.pasja-informatyki.pl/592078/brak-mozliwosci-nadpisania-tymczasowego-zdjecia-w-programie-c%23</link>
<description>Program to fotobudka.&lt;br /&gt;
Problem polega na tym ze program po zrobieniu kolejnych zdjęć nie może nadpisać tymczasowego zdjęcia w lokalizacji, w której ma prawa zapisu.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
[ WARN:0@7.015] global loadsave.cpp:759 cv::imwrite_ imwrite_('C:\Users\***\AppData\Local\Temp\temp_photo.jpg'): can't open file for writing: permission denied</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/592078/brak-mozliwosci-nadpisania-tymczasowego-zdjecia-w-programie-c%23</guid>
<pubDate>Tue, 12 Mar 2024 18:13:20 +0000</pubDate>
</item>
<item>
<title>Aplikacje Discorda</title>
<link>https://forum.pasja-informatyki.pl/591961/aplikacje-discorda</link>
<description>

&lt;p&gt;&lt;strong&gt;Witam Wszystkich Bardzo Serdecznie a Zwłaszcza Tych Których Urzekło i Zwróciło Uwagę Moje Pytanie,&lt;/strong&gt;&lt;/p&gt;



&lt;p&gt;&lt;em&gt;Chciałbym Nauczyć Się Kodować w Języku&amp;nbsp;&lt;strong&gt;C#&amp;nbsp;&lt;/strong&gt;Ale Niestety Jeszcze Nie Miałem z Nim Przyjemności. Ogólnie To Pragnę Zmienić Trochę Branżę i Chcę Zacząć Kodować w C# Dokładnie To Będę Chciał Stwarzać Aplikacje ( Boty ) Discord. Czy Macie Jakiś Fajny Poradnik / Wskazówki Cokolwiek Aby Mógł Lepiej Zrozumieć i Zacząć w Tej Dziedzinie? Z Góry Dziękuję Za Każdą Udzieloną Odpowiedź!&lt;/em&gt;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/591961/aplikacje-discorda</guid>
<pubDate>Thu, 07 Mar 2024 18:39:29 +0000</pubDate>
</item>
<item>
<title>Problem z ASP.NET CORE (Visual Studio) Entity Framework</title>
<link>https://forum.pasja-informatyki.pl/591883/problem-z-asp-net-core-visual-studio-entity-framework</link>
<description>

&lt;p&gt;Dzień dobry&lt;/p&gt;



&lt;p&gt;Mam problem z wygenerowanie gotowego szablony widoku oraz kontrolera. Gdy próbuje zrobić kontroler dla klasy, która jest połączona z bazą danych wyskakuje mi błąd. Wszystkie potrzebne pakiety są zainstalowane w odpowiednich do projektu wersjach a ponowna kompilacja nie działa.&lt;/p&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;error&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;https://forum.pasja-informatyki.pl/?qa=blob&amp;amp;qa_blobid=6580226593165122583&quot; style=&quot;height:262px; width:522px&quot;&gt;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/591883/problem-z-asp-net-core-visual-studio-entity-framework</guid>
<pubDate>Mon, 04 Mar 2024 16:09:09 +0000</pubDate>
</item>
<item>
<title>Wybór części danych z tablicy - radiobutton</title>
<link>https://forum.pasja-informatyki.pl/590741/wybor-czesci-danych-z-tablicy-radiobutton</link>
<description>

&lt;p&gt;Witam Mam tablicę i pętle for i dane są wrzucane do comboBox i jest ok. Lecz potrzebuje teraz zrobić co innego. Tablica jest 6 elementowa. Chcę zrobić tak że jak kliknę radiobutton1 to mam w combobox do wyboru:Opcja1, Opcja2, Opcja3,&amp;nbsp;a gdy kliknę radiobutton2 to mam do wyboru w comboBox: Opcja4, Opcja5, Opcja6. Zrobiłem if'a ale coś nie działa bo nic nie mogę wybrać.&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
public void wybor()
        {
            comboBox1.Text = &quot;wybierz opcje&quot;;

            string[] array = new string[6];
            array[0] = &quot;Opcja 1&quot;;
            array[1] = &quot;Opcja 2&quot;;
            array[2] = &quot;Opcja 3&quot;;
            array[3] = &quot;Opcja 4&quot;;
            array[4] = &quot;Opcja 5&quot;;
            array[5] = &quot;Opcja 6&quot;;

            if (radioButton1.Checked) 
            {
                    for (int i = 0; i &amp;lt; 3; i++)
                    {
                    comboBox1.Items.Add(array[i]);
                    }
            }

            else if (radioButton2.Checked)
            {
                for (int i = 3; i &amp;lt; 6; i++)
                {
                    comboBox1.Items.Add(array[i]);
                }
            }
           
        }&lt;/pre&gt;



&lt;p&gt;jak to można zmienić żeby działało?&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/590741/wybor-czesci-danych-z-tablicy-radiobutton</guid>
<pubDate>Thu, 18 Jan 2024 12:30:44 +0000</pubDate>
</item>
<item>
<title>Sprawdzenie elementów i dodawanie ich</title>
<link>https://forum.pasja-informatyki.pl/590627/sprawdzenie-elementow-i-dodawanie-ich</link>
<description>

&lt;p&gt;Cześć, potrzebuję porady a dokładnie to&amp;nbsp;jak mogę sprawdzić&amp;nbsp;czy dany element istnieje i nie dodawać go ponownie. Próbowałem jak w&amp;nbsp; kodzie niżej ale problem jest taki, że pomimo&amp;nbsp;znalezienia&amp;nbsp;tego obiektu&amp;nbsp;i&amp;nbsp;dodania&amp;nbsp;go,&amp;nbsp;to sprawdzenie w liście(inventory.weaponSlots) czy on już tam jest i &quot;blokady&quot; dodawania go ponownie&amp;nbsp;nie działa. Dodaje ponownie ten element.&amp;nbsp; Brakuje mi pomysłów jak to zrobić.&lt;/p&gt;



&lt;p&gt;Link do kodu:&amp;nbsp;&lt;a href=&quot;https://pastebin.com/2Huw5e30&quot; rel=&quot;nofollow&quot;&gt;https://pastebin.com/2Huw5e30&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Debug.Log na początku daje jako Null przed dodaniem a później jak ponownie chcemy dodać AxeWeapon to podaje AxeWeapon(Clone) (AxeWeapon)&lt;/p&gt;



&lt;p&gt;Jestem świeży w programowaniu więc nie krytykujcie za bardzo za ogólną jakość kodu. Całość&amp;nbsp;jest w Unity, jak coś jeszcze jest potrzebne to dajcie znać, podeślę. Z góry dzięki za pomoc.&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/590627/sprawdzenie-elementow-i-dodawanie-ich</guid>
<pubDate>Mon, 15 Jan 2024 13:30:21 +0000</pubDate>
</item>
<item>
<title>Powrót do programowania.</title>
<link>https://forum.pasja-informatyki.pl/590551/powrot-do-programowania</link>
<description>Cześć mam dość nietypowy problem, mianowicie chodzi o dość długą przerwę w programowaniu. Jestem absolwentem politechniki, mam tytuł inżyniera, na studiach radziłem sobie całkiem dobrze, nie miałem nigdy większych problemów, ale przez dość poważne problemy prywatne musiałem odłożyć to na bok, od prawie roku nie tknąłem żadnego kodu, w końcu wszystko się unormowało i chciałbym dostać pierwszą pracę, &amp;nbsp;ale moje wszystkie umiejętności, że tak powiem, trzeba odmrozić, dodatkowo jestem trochę zagubiony i nie jestem pewny, czym konkretnie w tym momencie powinienem się zająć, żeby to sprawnie poszło. Czy jest tu ktoś, kto mógłby podrzucić mi źródła do dość obszernej bazy jakichś ćwiczeń podstawowych, lecz bardziej tych zaawansowanych, oraz poinstruować mnie delikatnie jakie ruchy powinienem teraz wykonać, żeby szybko wrócić do stanu programowania sprzed roku? Obszar, w którym działałem to głównie C#, Unity, .NET. Z góry dziękuje wszystkim za pomoc, pozdrawiam!</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/590551/powrot-do-programowania</guid>
<pubDate>Thu, 11 Jan 2024 22:25:47 +0000</pubDate>
</item>
<item>
<title>Koncepcja podziału kodu na 2 projekty - jak to zrobić?</title>
<link>https://forum.pasja-informatyki.pl/590526/koncepcja-podzialu-kodu-na-2-projekty-jak-to-zrobic</link>
<description>

&lt;p&gt;Witam. Chciałem utworzyć aplikację, coś na zasadzie prostej gry sieciowej, którą&amp;nbsp;można by było w przyszłości modyfikować za pomocą Api. Aktualnie mam 2 projekty:&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
Game:
- Main.cs
&amp;nbsp; - Start();
&amp;nbsp; - Stop();
- Config.cs
&amp;nbsp; - Load();
&amp;nbsp; - Save();
- Network.cs
&amp;nbsp; - SendUdpTcpPacket();
&amp;nbsp; - RecieveUdpTcpPacket();&lt;/pre&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
GameApi:
- Player.cs
&amp;nbsp; - Move();
- World.cs
&amp;nbsp; - WhenPlayerClick();
- Game.cs
&amp;nbsp; - int HighScore;&lt;/pre&gt;



&lt;p&gt;Nazwy klas i funkcji są na razie przykładowe, dla zobrazowania tematu, na razie jeszcze nic nie zaimplementowałem.&amp;nbsp;Zastanawiam się jednak nad tym, jak&amp;nbsp;dobrać modyfikatory typu np. abstract, interface, virtual, etc. żeby móc działać pomiędzy tymi klasami. Bo o ile mogę dodać referencję np. z Game do GameApi, tak w drugą stronę już nie mogę, bo by się zapętliło. A chciałbym używać funkcji pomiędzy projektami, np:&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
// Project: Game

RecieveUdpTcpPacket()
{
&amp;nbsp; &amp;nbsp; if(Message == &quot;Move&quot;)
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GameApi.Player.Move();
&amp;nbsp; &amp;nbsp; }
}
&lt;/pre&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
// Project: GameApi

WhenPlayerClick()
{
&amp;nbsp; &amp;nbsp; if(Object == &quot;Button&quot;)
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Game.SendUdpTcpPacket(&quot;Click&quot;);
&amp;nbsp; &amp;nbsp; }
}&lt;/pre&gt;



&lt;p&gt;Wydaje mi się że najlepiej by było zrobić tak, aby w GameApi&amp;nbsp;była tylko definicja np. Player.Move(), tak żeby można byłą ją wykorzystać programując jakąś modyfikację do gry, a w Game jej implementacja, żeby, która np. wysyła odpowiedni pakiet do servera czy clienta.&amp;nbsp;Jak to można zrobić? Albo może jest jakiś inny sposób podziału takiej aplikacji?&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/590526/koncepcja-podzialu-kodu-na-2-projekty-jak-to-zrobic</guid>
<pubDate>Wed, 10 Jan 2024 21:27:28 +0000</pubDate>
</item>
<item>
<title>Polecacie jakiś tutorial do Unity</title>
<link>https://forum.pasja-informatyki.pl/590067/polecacie-jakis-tutorial-do-unity</link>
<description>Wiecie , taki darmowy i żeby było tłumaczone a nie żeby po prostu kopiować wszystko.</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/590067/polecacie-jakis-tutorial-do-unity</guid>
<pubDate>Sat, 16 Dec 2023 20:41:12 +0000</pubDate>
</item>
<item>
<title>Coroutine, Unity</title>
<link>https://forum.pasja-informatyki.pl/590032/coroutine-unity</link>
<description>

&lt;p&gt;Cześć, mam mały problem z wykorzystaniem coroutine. Wykorzystuję ją w proceduralnym generowaniu świata (takim jak mineraft).&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
IEnumerator VisualizeChunks()
{
    while (chunksToVisualizeList.Count &amp;gt; 0)
    {
        Debug.Log(&quot;1&quot;);
        AddNewBlocksToArray(chunksToVisualizeList[0].xGlobalPos / 6, chunksToVisualizeList[0].zGlobalPos / 6);
        
        while (chunksToVisualizeList.Count &amp;gt; 1)
        {

            Debug.Log(&quot;Elementy: &quot; + chunksToVisualizeList.Count);
            AddNewBlocksToArray(chunksToVisualizeList[1].xGlobalPos / 6, chunksToVisualizeList[1].zGlobalPos / 6);
            chunksToVisualizeList[0].VisualizeChunk();
            chunksToVisualizeList.RemoveAt(0);
            Debug.Log(&quot;2&quot;);
            yield return null;
        }
        Debug.Log(&quot;3&quot;);
        Debug.Log(&quot;elementy: &quot; + chunksToVisualizeList.Count);
        chunksToVisualizeList[0].VisualizeChunk();
        chunksToVisualizeList.RemoveAt(0);
        yield return null;
    }
    Debug.Log(&quot;koniec&quot;);
}&lt;/pre&gt;



&lt;p&gt;Problem polega na tym, że po wykonaniu ostatniej linijki w pętli nadrzędnej, liczyłem że zawsze będzie się wznawiać w tej linijce (czyli sprawdzac warunek w while czy lista niepusta).
&lt;br&gt;
Z jakiegoś powodu konsola wyrzuca mi ArgumentOutOfRangeException.
&lt;br&gt;
Ostatnie 5 linijek w konsoli to:
&lt;br&gt;
3
&lt;br&gt;
elementy: 1
&lt;br&gt;
3
&lt;br&gt;
elementy: 0
&lt;br&gt;
Error
&lt;br&gt;
Byłbym wdzięczny gdyby ktoś mi wyjaśnił gdzie popełniam błąd
&lt;br&gt;
&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/590032/coroutine-unity</guid>
<pubDate>Fri, 15 Dec 2023 20:10:48 +0000</pubDate>
</item>
<item>
<title>Wzorzec MVVM - Nie znaleziono elementu DataContext dla powiązania</title>
<link>https://forum.pasja-informatyki.pl/589979/wzorzec-mvvm-nie-znaleziono-elementu-datacontext-dla-powiazania</link>
<description>

&lt;p&gt;Piszę aktualnie projekt za pomocą wzorca MVVM i napotkałem pewien błąd:&amp;nbsp;
&lt;br&gt;
&quot;Nie znaleziono elementu DataContext dla powiązania (i jakiś Binding)&quot;. Nie jestem pewien czemu&amp;nbsp;nie działają te bindingi ponieważ pierwszy raz piszę za pomocą tego wzorca. Oto mój kod:
&lt;br&gt;
Strona rejestracji Xaml oraz Cs:&lt;/p&gt;



&lt;pre class=&quot;brush:xml;&quot;&gt;
&amp;lt;Page x:Class=&quot;WorkApp.MVVM.Pages.RegisterPage&quot;
      xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
      xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
      xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot; 
      xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot; 
      xmlns:local=&quot;clr-namespace:WorkApp.MVVM.Pages&quot;
      mc:Ignorable=&quot;d&quot; 
      d:DesignHeight=&quot;600&quot; d:DesignWidth=&quot;900&quot;
      Title=&quot;RegisterPage&quot;&amp;gt;
    
    &amp;lt;Border CornerRadius=&quot;20&quot;
        Background=&quot;#366bd6&quot;&amp;gt;
        &amp;lt;Grid&amp;gt;
            &amp;lt;Grid.ColumnDefinitions&amp;gt;
                &amp;lt;ColumnDefinition Width=&quot;200&quot;/&amp;gt;
                &amp;lt;ColumnDefinition/&amp;gt;
            &amp;lt;/Grid.ColumnDefinitions&amp;gt;

            &amp;lt;Grid.RowDefinitions&amp;gt;
                &amp;lt;RowDefinition Height=&quot;75&quot;/&amp;gt;
                &amp;lt;RowDefinition /&amp;gt;
            &amp;lt;/Grid.RowDefinitions&amp;gt;


            &amp;lt;Label Content=&quot;Work&quot;
               HorizontalContentAlignment=&quot;Center&quot;
               VerticalContentAlignment=&quot;Center&quot;
               FontSize=&quot;30&quot;
                   Background=&quot;#325ea8&quot;
               /&amp;gt;

            &amp;lt;Label Content=&quot;Register&quot;
               HorizontalContentAlignment=&quot;Center&quot;
               VerticalContentAlignment=&quot;Center&quot;
               FontSize=&quot;30&quot;
               Grid.Column=&quot;1&quot;
               Background=&quot;#325ea8&quot;
               /&amp;gt;


            &amp;lt;StackPanel Grid.Row=&quot;1&quot; 
              Grid.Column=&quot;0&quot; 
              Margin=&quot;10&quot;
              Grid.ColumnSpan=&quot;2&quot;
              &amp;gt;
                &amp;lt;StackPanel&amp;gt;
                    &amp;lt;Label HorizontalAlignment=&quot;Center&quot; Content=&quot;Name&quot; Foreground=&quot;White&quot; FontSize=&quot;20&quot;/&amp;gt;
                    &amp;lt;TextBox Style=&quot;{StaticResource LoginRegisterTextBoxTheme}&quot; Margin=&quot;0,0,0,10&quot; Text=&quot;{Binding Name}&quot;/&amp;gt;
                &amp;lt;/StackPanel&amp;gt;

                &amp;lt;StackPanel&amp;gt;
                    &amp;lt;Label HorizontalAlignment=&quot;Center&quot; Content=&quot;Surname&quot; Foreground=&quot;White&quot; FontSize=&quot;20&quot;/&amp;gt;
                    &amp;lt;TextBox Style=&quot;{StaticResource LoginRegisterTextBoxTheme}&quot; Margin=&quot;0,0,0,10&quot; Text=&quot;{Binding Surname}&quot;/&amp;gt;
                &amp;lt;/StackPanel&amp;gt;


                &amp;lt;StackPanel&amp;gt;
                    &amp;lt;Label HorizontalAlignment=&quot;Center&quot; Content=&quot;Email&quot; Foreground=&quot;White&quot; FontSize=&quot;20&quot;/&amp;gt;
                    &amp;lt;TextBox Style=&quot;{StaticResource LoginRegisterTextBoxTheme}&quot; Margin=&quot;0,0,0,10&quot; Text=&quot;{Binding Email}&quot;/&amp;gt;
                &amp;lt;/StackPanel&amp;gt;


                &amp;lt;StackPanel&amp;gt;
                    &amp;lt;Label HorizontalAlignment=&quot;Center&quot; Content=&quot;Password&quot; Foreground=&quot;White&quot; FontSize=&quot;20&quot;/&amp;gt;
                    &amp;lt;TextBox Style=&quot;{StaticResource LoginRegisterTextBoxTheme}&quot; Text=&quot;{Binding PasswordHash}&quot;/&amp;gt;
                &amp;lt;/StackPanel&amp;gt;


                &amp;lt;StackPanel&amp;gt;
                    &amp;lt;Label HorizontalAlignment=&quot;Center&quot; Content=&quot;Repeat password&quot; Foreground=&quot;White&quot; FontSize=&quot;20&quot;/&amp;gt;
                    &amp;lt;TextBox Style=&quot;{StaticResource LoginRegisterTextBoxTheme}&quot; Margin=&quot;0,0,0,10&quot;/&amp;gt;
                &amp;lt;/StackPanel&amp;gt;

                &amp;lt;StackPanel&amp;gt;
                    &amp;lt;Button Style=&quot;{StaticResource LoginLogoutButtonTheme}&quot; Content=&quot;Register&quot; FontSize=&quot;20&quot; Width=&quot;200&quot; Background=&quot;#325ea8&quot; Click=&quot;LoginAndBackToMainPage&quot; Command=&quot;{Binding AddNewUserCommand}&quot;/&amp;gt;

                    &amp;lt;Button Style=&quot;{StaticResource LoginLogoutButtonTheme}&quot; Content=&quot;Do you have account? Login now!&quot;  FontSize=&quot;20&quot; Width=&quot;200&quot; Background=&quot;#325ea8&quot; Click=&quot;GoToLoginrPage&quot;/&amp;gt;

                    &amp;lt;Button Style=&quot;{StaticResource LoginLogoutButtonTheme}&quot; Content=&quot;Back to Main Page&quot; FontSize=&quot;20&quot; Width=&quot;200&quot; Background=&quot;#325ea8&quot; Click=&quot;BackGoMainPage&quot;/&amp;gt;
                &amp;lt;/StackPanel&amp;gt;

            &amp;lt;/StackPanel&amp;gt;
        &amp;lt;/Grid&amp;gt;
    &amp;lt;/Border&amp;gt;
&amp;lt;/Page&amp;gt;
&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
using WorkApp.MVVM.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WorkApp.MVVM.Pages
{
    /// &amp;lt;summary&amp;gt;
    /// Logika interakcji dla klasy RegisterPage.xaml
    /// &amp;lt;/summary&amp;gt;
    public partial class RegisterPage : Page
    {
        public RegisterPage()
        {
            InitializeComponent();
            AddNewUser newUser = new();
            DataContext = newUser;
        }

        private void LoginAndBackToMainPage(object sender, RoutedEventArgs e)
        {

        }

        private void GoToRegisterPage(object sender, RoutedEventArgs e)
        {

        }

        private void BackGoMainPage(object sender, RoutedEventArgs e)
        {
            if (App.Current.MainWindow is MainWindow mainWindow)
            {
                mainWindow.ChangePage(new MainPage());
            }
        }

        private void GoToLoginrPage(object sender, RoutedEventArgs e)
        {
            if (App.Current.MainWindow is MainWindow mainWindow)
            {
                mainWindow.ChangePage(new LoginPage());
            }
        }
    }
}
&lt;/pre&gt;



&lt;p&gt;Folder &quot;Model&quot; klasa &quot;UserManager&quot;:&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
using Microsoft.Data.Sqlite;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WorkApp.MVVM.Model
{
    public class UserManager
    {
        public static void InsertUserData(Users user)
        {
            string dbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), &quot;work.db&quot;);

            using (var db = new SqliteConnection($&quot;Filename={dbPath}&quot;))
            {
                db.Open();
                var insertCommand = new SqliteCommand();
                insertCommand.Connection = db;

                insertCommand.CommandText = &quot;INSERT INTO users VALUES(NULL, @Name, @Surname, NULL ,@Email, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @Password, NULL, 0);&quot;;
                insertCommand.Parameters.AddWithValue(&quot;@Name&quot;, user.Name);
                insertCommand.Parameters.AddWithValue(&quot;@Surname&quot;, user.Surname);
                insertCommand.Parameters.AddWithValue(&quot;@Email&quot;, user.Email);
                insertCommand.Parameters.AddWithValue(&quot;@Password&quot;, user.PasswordHash);
                insertCommand.ExecuteReader();
            }
        }

    }
}
&lt;/pre&gt;



&lt;p&gt;Folder &quot;ViewModel&quot; klasa &quot;AddNewUser&quot;:&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
using WorkApp.MVVM.Commands;
using WorkApp.MVVM.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace WorkApp.MVVM.ViewModel
{
    public class AddNewUser
    {
        public ICommand AddNewUserCommand { get; set; }


        public string _Name { get; set; }
        public string _Surname { get; set; }
        public string _Email { get; set; }
        public string _PasswordHash { get; set; }

        public AddNewUser() 
        {
            AddNewUserCommand = new RelayCommand(AddUser, CanAddUser);
        }

        private bool CanAddUser(object obj)
        {
            return true;
        }

        private void AddUser(object obj)
        {
            Users users = new(){
                Name = _Name, 
                Surname = _Surname, 
                Email = _Email, 
                PasswordHash = _PasswordHash
            };

            UserManager.InsertUserData(users);
        }
    }
}
&lt;/pre&gt;



&lt;p&gt;Folder &quot;Commands&quot; klasa &quot;RelayCommand&quot;:&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace WorkApp.MVVM.Commands
{
    public class RelayCommand : ICommand
    {
        public event EventHandler? CanExecuteChanged;

        private Action&amp;lt;object&amp;gt; _Excute {  get; set; }
        private Predicate&amp;lt;object&amp;gt; _CanExcute { get; set; }

        public RelayCommand(Action&amp;lt;object&amp;gt; executeMethod, Predicate&amp;lt;object&amp;gt; CanExcuteMethod) 
        { 
            _Excute = executeMethod;
            _CanExcute = CanExcuteMethod;
        }

        public bool CanExecute(object? parameter)
        {
            return _CanExcute(parameter);
        }

        public void Execute(object? parameter)
        {
            _Excute(parameter);
        }
    }
}
&lt;/pre&gt;



&lt;p&gt;z góry dziękuję za pomoc&amp;nbsp;&lt;img alt=&quot;smiley&quot; src=&quot;https://forum.pasja-informatyki.pl/qa-plugin/ckeditor4/plugins/smiley/images/regular_smile.png&quot; style=&quot;height:23px; width:23px&quot; title=&quot;smiley&quot;&gt;.&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/589979/wzorzec-mvvm-nie-znaleziono-elementu-datacontext-dla-powiazania</guid>
<pubDate>Tue, 12 Dec 2023 20:28:43 +0000</pubDate>
</item>
<item>
<title>Mnożenie macierzy w c#</title>
<link>https://forum.pasja-informatyki.pl/589887/mnozenie-macierzy-w-c%23</link>
<description>

&lt;p&gt;Prosiłbym o pomoc w znalezieniu błędu w kodzie&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
Console.Write(&quot;podaj ilosc wierszy pierwszej macierzy:&quot;);
int wiersze1 = int.Parse(Console.ReadLine());
Console.Write(&quot;podaj ilosc kolumn pierwszej macierzy:&quot;);
int kolumny1 = int.Parse(Console.ReadLine());
int[,] tab1 = new int[wiersze1, kolumny1];

for (int i=0; i&amp;lt;wiersze1;i++ )
    {
        Console.WriteLine(&quot;podaj elementy {0} wiersza&quot;, i+1);
        for (int j = 0; j &amp;lt; kolumny1; j++)
        {
            tab1[i, j] = int.Parse(Console.ReadLine());
        }
    }

Console.WriteLine(&quot;twoja 1 macierz to:&quot;);
for (int i = 0; i &amp;lt; wiersze1  ; i++)
{
    for (int j = 0; j &amp;lt; kolumny1; j++)
    {
        Console.Write(&quot;{0} &quot;, tab1[i, j]);
    }
    Console.WriteLine();
}


///2macierz

Console.Write(&quot;podaj ilosc wierszy drugiej macierzy:&quot;);
int wiersze2 = int.Parse(Console.ReadLine());
Console.Write(&quot;podaj ilosc kolumn drugiej macierzy:&quot;);
int kolumny2 = int.Parse(Console.ReadLine());

int[,] tab2 = new int[wiersze2, kolumny2];
int[,] tab1tab2 = new int[wiersze1, kolumny1];

for (int i = 0; i &amp;lt; wiersze2; i++)
{
    Console.WriteLine(&quot;podaj elementy {0} wiersza&quot;, i + 1);
    for (int j = 0; j &amp;lt; kolumny2; j++)
    {
        tab2[i, j] = int.Parse(Console.ReadLine());
    }
}

Console.WriteLine(&quot;twoja 2 macierz to:&quot;);
for (int i = 0; i &amp;lt; wiersze2; i++)
{
    for (int j = 0; j &amp;lt; kolumny2; j++)
    {
        Console.Write(&quot;{0} &quot;, tab2[i, j]);
    }
    Console.WriteLine();
}



///mnozenie
Console.WriteLine(&quot;\nMnozenie macierzy:&quot;);
for (int i = 0; i &amp;lt; wiersze1; i++)
{
    for (int k = 0; k &amp;lt; kolumny2; k++)
    {
        for (int j = 0; j &amp;lt; kolumny1; j++)
        {
            tab1tab2[i, k] += tab1[i, j] * tab2[j, k];
        }
    }
}

Console.WriteLine(&quot;\nM1 x M2: &quot;);
for (int i = 0; i &amp;lt; wiersze1; i++)
{
    for (int k = 0; k &amp;lt; kolumny2; k++)
    {
        Console.Write(&quot;{0} &quot;, tab1tab2[i, k]);
    }
}&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/589887/mnozenie-macierzy-w-c%23</guid>
<pubDate>Thu, 07 Dec 2023 18:37:43 +0000</pubDate>
</item>
<item>
<title>EasyTabs C# problem z wyglądem programu</title>
<link>https://forum.pasja-informatyki.pl/589603/easytabs-c%23-problem-z-wygladem-programu</link>
<description>

&lt;p&gt;Kiedy używam EasyTabs c# winforms aby mieć karty, na niektórych komputerach easy tabs zmienia całkowicie czcionkę mojego programu i go niszczy, dzieje tak się tylko na niektórych komputerach. Ma ktoś jakiś pomysł jak to rozwiązać?
&lt;br&gt;
Jak powinno wyglądać:
&lt;br&gt;
&lt;img alt=&quot;&quot; src=&quot;https://media.discordapp.net/attachments/944226785799856138/1178036476458578030/image.png?ex=6574aef6&amp;amp;is=656239f6&amp;amp;hm=c90a8282f4f9152b709f6994e2116990d3b3ba4eeb27e38d2688092e7b9f3471&amp;amp;=&amp;amp;format=webp&amp;amp;width=1246&amp;amp;height=700&quot; style=&quot;height:700px; width:1246px&quot;&gt;
&lt;br&gt;
Jak wygląda:
&lt;br&gt;
&lt;img alt=&quot;&quot; src=&quot;https://media.discordapp.net/attachments/944226785799856138/1178038395218428125/image.png?ex=6574b0c0&amp;amp;is=65623bc0&amp;amp;hm=f54c4f5015a2b4ca0af8a5d7af0e4e029bf258b9b4ca1c2cc042958f111f23c6&amp;amp;=&amp;amp;format=webp&amp;amp;width=1120&amp;amp;height=700&quot; style=&quot;height:700px; width:1120px&quot;&gt;Problem występuje jedynie na niektórych urządzeniach i powstał po dodaniu EasyTabs&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/589603/easytabs-c%23-problem-z-wygladem-programu</guid>
<pubDate>Sat, 25 Nov 2023 18:26:12 +0000</pubDate>
</item>
<item>
<title>Pętla z zmienną nazwą textBox ?</title>
<link>https://forum.pasja-informatyki.pl/589207/petla-z-zmienna-nazwa-textbox</link>
<description>

&lt;p&gt;Witam! Wie że to będzie pytanie banalne ale zaczynam naukę z C#.&lt;/p&gt;



&lt;p&gt;Mam taki banalny skrypt który mi wpisuje dane z tablicy do textbox'ow:&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
private void button1_Click(object sender, EventArgs e)
        {
            string[] tablica = { &quot;black&quot;, &quot;green&quot;, &quot;yellow&quot;, &quot;blue&quot; };
            textBox1.Text = tablica[0];
            textBox2.Text = tablica[1];
            textBox3.Text = tablica[2];
            textBox4.Text = tablica[3];
        }
&lt;/pre&gt;



&lt;p&gt;można to zrobić jakoś z pętlą for żeby był &quot;ładniej&quot;&lt;/p&gt;



&lt;p&gt;zacząłęm:&lt;/p&gt;



&lt;p&gt;&amp;nbsp;for (int i = 0; i &amp;lt; tablica.Length; i++)
&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string zmienna &amp;nbsp;= tablica[i];&lt;/p&gt;



&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;?????&amp;nbsp; &amp;nbsp;
&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;



&lt;p&gt;i utknąłem, nie wiem co wpisać w pytajniki, nie wiem jak zrobić &quot;textBoxy&quot; żeby miały numery:&amp;nbsp;textBox1.Text,&amp;nbsp;textBox2.Text,&amp;nbsp;textBox3.Text,&amp;nbsp;textBox4.Text&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/589207/petla-z-zmienna-nazwa-textbox</guid>
<pubDate>Thu, 09 Nov 2023 22:30:55 +0000</pubDate>
</item>
<item>
<title>Minecraft - generowanie złóż surowców, Unity</title>
<link>https://forum.pasja-informatyki.pl/589199/minecraft-generowanie-zloz-surowcow-unity</link>
<description>Cześć, chciałem poprosić o radę z czego mógłbym skorzystać, aby moc w losowych (lub pseudolosowych) miejscach generować dane surowce? Skorzystałem już z PerlinNoise, aby generować ukształtowanie terenu i zastanawiałem się czy może istnieje już jakaś wbudowana funkcja, która mogłaby mi pomóc i w tym przypadku? Zastanawiałem, się czy skorzystać tutaj z funkcji Random, do generowania współrzędnych danych surowców, ale mam wrażenie, że wtedy będę od góry wybierał liczbę złóż surowców na danej części świata i tak mnie to trochę zniechęca.&lt;br /&gt;
(Oczywiście jak w temacie, gra którą rekonstruuję to minecraft i używam do tego silinika Unity oraz C#)</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/589199/minecraft-generowanie-zloz-surowcow-unity</guid>
<pubDate>Thu, 09 Nov 2023 17:31:35 +0000</pubDate>
</item>
<item>
<title>Biblioteka klas C# .Net Dll z referencjami do innych bibliotek.</title>
<link>https://forum.pasja-informatyki.pl/588765/biblioteka-klas-c%23-net-dll-z-referencjami-do-innych-bibliotek</link>
<description>

&lt;p&gt;Witam. Utworzyłem projekt, który jest biblioteką klas. Ten projekt zawiera referencje do pakietu &lt;strong&gt;NetwonsoftJson&lt;/strong&gt; pobranego z &lt;strong&gt;NuGet&lt;/strong&gt;. Przy kompilacji i próbie użycia tego pliku DLL, np. w aplikacji&amp;nbsp;konsolowej, dostaję błąd:&amp;nbsp;&lt;strong&gt;Could not load file or assembly, NetwonsoftJson&lt;/strong&gt;. Jak mogę skompilować projekt biblioteki klas, tak aby zawierał wszystkie referencje?&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/588765/biblioteka-klas-c%23-net-dll-z-referencjami-do-innych-bibliotek</guid>
<pubDate>Mon, 16 Oct 2023 18:55:03 +0000</pubDate>
</item>
<item>
<title>Windows Form DataGridView C#</title>
<link>https://forum.pasja-informatyki.pl/588487/windows-form-datagridview-c%23</link>
<description>

&lt;p&gt;Witam z tej strony początkujący programista C#. Na to forum natknąłem się kiedyś przy pierwszych korkach C++.
&lt;br&gt;

&lt;br&gt;
Myślę że ogarnąłem już podstawy podstaw i kieruje swój rozwój na aplikacje okienkowe.&amp;nbsp;
&lt;br&gt;

&lt;br&gt;
Mam następujący problem i pytanie zarazem. Mam plik csv, który importuje do programu i zaczytuje go poprzez BingidListy. Oczywiście przypisałem komponent DataGridView do mojej listy. Napisałem odpowiedni kod i odczyt zapis działa. Program wczytuje zawartość csv oraz dodaje nowe rekordy. Kolejnym problemem jaki mam do rozwiązania i zrozumienia jest filtrowanie treści jaki przechowuje csv i wyświetlenie jej w komponencie DataGridView.&amp;nbsp;
&lt;br&gt;

&lt;br&gt;
Poniżej mój kod, który stworzyłem ale nie działa, po wielu próbach nie mogę jakoś sobie poradzić. Ba nawet zszedłem do Consoli by na szybko sprawdzić czy czegoś źle nie robię. Z góry przepraszam za pewne nazwy takie zobaczenie jak coś nie działa to jest to .... :(&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
        private void button1_wyszukaj_Click(object sender, EventArgs e)
        {

            if (File.Exists(plik))
            {
                using var reader = new StreamReader(plik);
                using var csv_reader = new CsvReader(reader, CultureInfo.InvariantCulture);
                var dane = csv_reader.GetRecords&amp;lt;Dane&amp;gt;().ToList();

                separacja(dane);
            }

        }
        private void separacja(List&amp;lt;Dane&amp;gt; dane)
        {
            dupa.Clear();

            foreach (var element in dane)
            {
                dupa.Where(o =&amp;gt; o.imie.Contains(&quot;AXE&quot;));
            }
                                     
        }&lt;/pre&gt;



&lt;p&gt;
&lt;br&gt;

&lt;br&gt;
&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/588487/windows-form-datagridview-c%23</guid>
<pubDate>Tue, 03 Oct 2023 13:31:48 +0000</pubDate>
</item>
<item>
<title>Kiedy programowanie obiektowe</title>
<link>https://forum.pasja-informatyki.pl/588217/kiedy-programowanie-obiektowe</link>
<description>Hejka&lt;br /&gt;
&lt;br /&gt;
Mógłby mi ktoś pomóc? Kiedy powinniśmy używać programowania obiektowego? Już trochę zagłębiłem się w temat ale informacje jakie uzyskałem to takie:&lt;br /&gt;
a) wtedy kiedy chcemy aby było profesjonalnie&lt;br /&gt;
b) wtedy kiedy nad aplikacją pracuje więcej osób&lt;br /&gt;
bądź&lt;br /&gt;
c) wtedy kiedy robimy dużą aplikacje&lt;br /&gt;
&lt;br /&gt;
W tym temacie jestem dość zielony, więc nie wiem m.in ile musi mieć kodu aby aplikacja była duża. Wiem jak się tworzy klasy i z nich się korzysta ale nie wiem kiedy używać :/&lt;br /&gt;
&lt;br /&gt;
Jeżeli ktoś ma do polecenia jakieś stronki z zadaniami z programowania obiektowego to też chętnie przygarnę.&lt;br /&gt;
Z góry dzięki za pomoc :)</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/588217/kiedy-programowanie-obiektowe</guid>
<pubDate>Sat, 23 Sep 2023 16:59:22 +0000</pubDate>
</item>
<item>
<title>Niedziałający czasomierz</title>
<link>https://forum.pasja-informatyki.pl/588106/niedzialajacy-czasomierz</link>
<description>

&lt;p&gt;Witam
&lt;br&gt;
Zrobiłem czasomierz, który nie wiedzieć czemu się zacina. Ogólnie to działa, gdy wepcham MessegeBox'a do środka pętli i gdy kliknę &quot;okej&quot; to zegar traci wartość o 1. Jednak gdy użyję sleep coś się krzyczy. Ktoś by mógł mi powiedzieć dlaczego i co zrobić w takiej sytuacji
&lt;br&gt;

&lt;br&gt;
zmienna countTime jest typu DateTime a strTime typu string. Wszystko jest robione przy pomocy winforms.&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
DateTime startTime = new DateTime();

startTime = startTime.AddMinutes((int)numTime.Value);
countTime = startTime;

strTime = startTime.Minute.ToString() + &quot;:&quot; + startTime.Second.ToString() + &quot;:&quot; + startTime.Millisecond.ToString();

lblTime.Text = strTime;

while (countTime &amp;gt; DateTime.MinValue)
{
    Thread.Sleep(1);
    countTime = countTime.AddMilliseconds(-1);

    strTime = countTime.Minute.ToString() + &quot;:&quot; + countTime.Second.ToString() + &quot;:&quot; + countTime.Millisecond.ToString();

    lblTime.Text = strTime;
}&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/588106/niedzialajacy-czasomierz</guid>
<pubDate>Tue, 19 Sep 2023 19:48:06 +0000</pubDate>
</item>
<item>
<title>Z wartości DEC na HEX - najprościej ?</title>
<link>https://forum.pasja-informatyki.pl/587536/z-wartosci-dec-na-hex-najprosciej</link>
<description>

&lt;p&gt;Witam! Napisałem sobie taki mały konwerter zmieniający mi wartość dziesiętną na szesnastkową:&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
private void button1_Click(object sender, EventArgs e)
        {        
            int intValue = int.Parse(textBox1.Text);

            string hexValue = intValue.ToString(&quot;X4&quot;);

            string name = Convert.ToString(hexValue);
            textBox2.Text = name;
        }&lt;/pre&gt;



&lt;p&gt;Czyli po kliknięciu w Button pobiera wartość z textBox1 i konwertuje na szesnastkowy i wrzuca do texbox2 (dopisuje zera gdy są przed wartością np. z C na 000C)&lt;/p&gt;



&lt;p&gt;Chciałbym jeszcze żeby do textbox3 przerabiało mi z wartości dziesiętnej do binarnej (też 4 znaki) tylko kombinuje i ciagle mam jakiś błąd. Jak to można łatwo zrobić?&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/587536/z-wartosci-dec-na-hex-najprosciej</guid>
<pubDate>Thu, 24 Aug 2023 08:21:56 +0000</pubDate>
</item>
<item>
<title>Wybór w combobox wartości i przyporządkowany do niej wartości ?</title>
<link>https://forum.pasja-informatyki.pl/587490/wybor-w-combobox-wartosci-i-przyporzadkowany-do-niej-wartosci</link>
<description>

&lt;p&gt;Witam! Mam taki prosty skrypt:&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
&amp;nbsp;public Form1()
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InitializeComponent();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cb_values(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
private void cb_values()
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string[] type = new string[] { &quot;jeden&quot;, &quot;dwa&quot;, &quot;trzy&quot; };

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; type.Length; i++)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; comboBox1.Items.Add(type[i]);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string wartosc1 = comboBox1.Text;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; textBox1.Text = wartosc1;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;



&lt;p&gt;Tylko po pierwsze wartości z comboBox1 mi nie wrzuca do textBox1.&amp;nbsp;&lt;/p&gt;



&lt;p&gt;A po drugie co trudniejsze chcę żeby po wyborze z comboBox1 &quot;jeden&quot; wpisywało mi do textBox1 inną przyporządkowaną wartość. Dla wyboru w comboBox1 &quot;jeden&quot; w textBox żeby było &quot;AAA&quot; dla &quot;dwa&quot; = &quot;BBB&quot; dla &quot;trzy&quot;&amp;nbsp;= &quot;CCC&quot;&lt;/p&gt;



&lt;p&gt;Nie wiem czy to trzeba drugą tablicę stworzyć np. string[] type2 = new string[] { &quot;AAA&quot;, &quot;BBB&quot;, &quot;CCC&quot; };&lt;/p&gt;



&lt;p&gt;i to jakoś połączyć?&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/587490/wybor-w-combobox-wartosci-i-przyporzadkowany-do-niej-wartosci</guid>
<pubDate>Wed, 23 Aug 2023 08:41:48 +0000</pubDate>
</item>
<item>
<title>System.InvalidCastException: Object cannot be cast from DBNull to other types.</title>
<link>https://forum.pasja-informatyki.pl/587225/system-invalidcastexception-object-cannot-be-cast-from-dbnull-to-other-types</link>
<description>

&lt;p&gt;Cześć,&amp;nbsp;&lt;/p&gt;



&lt;p&gt;Mam problem, z stworzeniem pierwszej migracji inicjującej całą bazę danych na zdalnym serwerze mysql. Kiedy próbuje wpisać do consoli komendę update-database wyskakuję mi taki długi wyjątek:&amp;nbsp;&lt;/p&gt;



&lt;p&gt;update-database
&lt;br&gt;
Both Entity Framework Core and Entity Framework 6 are installed. The Entity Framework Core tools are running. Use 'EntityFramework6\Update-Database' for Entity Framework 6.
&lt;br&gt;
Build started...
&lt;br&gt;
Build succeeded.
&lt;br&gt;
System.InvalidCastException: Object cannot be cast from DBNull to other types.
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at MySql.Data.MySqlClient.Driver.LoadCharacterSetsAsync(MySqlConnection connection, Boolean execAsync, CancellationToken cancellationToken)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at MySql.Data.MySqlClient.Driver.ConfigureAsync(MySqlConnection connection, Boolean execAsync, CancellationToken cancellationToken)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at MySql.Data.MySqlClient.MySqlConnection.OpenAsync(Boolean execAsync, CancellationToken cancellationToken)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at MySql.Data.MySqlClient.MySqlConnection.Open()
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at MySql.EntityFrameworkCore.Storage.Internal.MySQLDatabaseCreator.&amp;lt;&amp;gt;c__DisplayClass16_0.&amp;lt;Exists&amp;gt;b__0(DateTime giveUp)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.&amp;lt;&amp;gt;c__DisplayClass12_0`2.&amp;lt;Execute&amp;gt;b__0(DbContext _, TState s)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at MySql.EntityFrameworkCore.Storage.Internal.MySQLExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, TState state, Func`2 operation, Func`2 verifySucceeded)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, TState state, Func`2 operation)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at MySql.EntityFrameworkCore.Storage.Internal.MySQLDatabaseCreator.Exists(Boolean retryOnNotExists)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at MySql.EntityFrameworkCore.Storage.Internal.MySQLDatabaseCreator.Exists()
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String connectionString, String contextType)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String connectionString, String contextType)
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.&amp;lt;&amp;gt;c__DisplayClass0_0.&amp;lt;.ctor&amp;gt;b__0()
&lt;br&gt;
&amp;nbsp; &amp;nbsp;at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
&lt;br&gt;
Object cannot be cast from DBNull to other types.&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;Próbowałem już używać różnych paczek do mysql, ale wciąż dostaje ten błąd &lt;a rel=&quot;nofollow&quot; href=&quot;https://stackoverflow.com/questions/74060289/mysqlconnection-open-system-invalidcastexception-object-cannot-be-cast-from-d&quot;&gt;stack&lt;/a&gt;. Nawet zmieniałem konto do bazy danych które ma całkowite uprawnienia i równiez to samo.&amp;nbsp;Może mnie ktoś nakierować o co w tym błędzie chodzi i jak go rozwiązać? Mogę jeszcze dodać jak wygląda u mnie ApplicationDbContext.&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;

namespace Elaborate.Models
{
    public class ApplicationDbContext : IdentityDbContext&amp;lt;IdentityUser&amp;gt;
    {
        public ApplicationDbContext(DbContextOptions&amp;lt;ApplicationDbContext&amp;gt; options) : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);

        }
    }
}
&lt;/pre&gt;



&lt;p&gt;Używam .NET 7,&amp;nbsp;Wersja serwera: 10.11.3-MariaDB-1 - Debian 12, czy są jakieś potrzebne inne informacje aby rozwiązać ten problem? Pokażę obecnie jakie są inne paczki obecnie zainstalowane.&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
&amp;lt;ItemGroup&amp;gt;
    &amp;lt;PackageReference Include=&quot;Microsoft.AspNetCore.Authentication.JwtBearer&quot; Version=&quot;7.0.10&quot; /&amp;gt;
    &amp;lt;PackageReference Include=&quot;Microsoft.AspNetCore.Identity.EntityFrameworkCore&quot; Version=&quot;7.0.10&quot; /&amp;gt;
    &amp;lt;PackageReference Include=&quot;Microsoft.AspNetCore.SpaProxy&quot; Version=&quot;7.0.10&quot; /&amp;gt;
    &amp;lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.SqlServer&quot; Version=&quot;7.0.10&quot; /&amp;gt;
    &amp;lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Tools&quot; Version=&quot;7.0.10&quot;&amp;gt;
      &amp;lt;PrivateAssets&amp;gt;all&amp;lt;/PrivateAssets&amp;gt;
      &amp;lt;IncludeAssets&amp;gt;runtime; build; native; contentfiles; analyzers; buildtransitive&amp;lt;/IncludeAssets&amp;gt;
    &amp;lt;/PackageReference&amp;gt;
    &amp;lt;PackageReference Include=&quot;MySql.Data&quot; Version=&quot;8.1.0&quot; /&amp;gt;
    &amp;lt;PackageReference Include=&quot;MySql.Data.EntityFramework&quot; Version=&quot;8.1.0&quot; /&amp;gt;
    &amp;lt;PackageReference Include=&quot;MySql.EntityFrameworkCore&quot; Version=&quot;7.0.5&quot; /&amp;gt;
  &amp;lt;/ItemGroup&amp;gt;&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/587225/system-invalidcastexception-object-cannot-be-cast-from-dbnull-to-other-types</guid>
<pubDate>Sun, 13 Aug 2023 21:27:00 +0000</pubDate>
</item>
<item>
<title>C# Windows forms błąd. Random</title>
<link>https://forum.pasja-informatyki.pl/586416/c%23-windows-forms-blad-random</link>
<description>

&lt;p&gt;Robie program w którym zgaduje się losową liczbę. Tylko właśnie nie mogę dać Randoma poza funkcję.&lt;/p&gt;



&lt;p&gt;Chodzi o&amp;nbsp;int koniec = losowa.Next(1, 12);&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
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;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;
using System.Security.Cryptography.X509Certificates;

namespace MineGame
{
&amp;nbsp; &amp;nbsp; public partial class Form1 : Form
&amp;nbsp; &amp;nbsp; {

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Random losowa = new Random();

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public Form1()
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InitializeComponent(); &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private void Form1_Load(object sender, EventArgs e)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int koniec = losowa.Next(1, 12);

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private void btn1_Click(object sender, EventArgs e)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (btn1.Text == koniec.ToString())
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Application.Exit();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; btn1.Enabled = false;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; btn1.Text = &quot;&quot;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Nazwa.Text = koniec.ToString();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/586416/c%23-windows-forms-blad-random</guid>
<pubDate>Sat, 08 Jul 2023 12:41:03 +0000</pubDate>
</item>
<item>
<title>ASP .Net Core - nowe podejście: Minimal APIs - warto?</title>
<link>https://forum.pasja-informatyki.pl/586366/asp-net-core-nowe-podejscie-minimal-apis-warto</link>
<description>Chciałem zapytać o nowe podejście Minimal APIs w ASP .Net Core... Czy warto je poznać? Czy jest przyszłościowe? Czy zastąpi dotychczasowe, czy raczej równolegle będą współistnieć. Jakie ma zalety, wady, ograniczenia?&lt;br /&gt;
&lt;br /&gt;
Czytałem, że to &amp;quot;nowy, uproszczony i oczyszczony sposób na pisanie API&amp;quot; w C#.. Jakie są Wasze doświadczenia?&lt;br /&gt;
&lt;br /&gt;
Dzięki!</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/586366/asp-net-core-nowe-podejscie-minimal-apis-warto</guid>
<pubDate>Thu, 06 Jul 2023 14:55:17 +0000</pubDate>
</item>
<item>
<title>Błąd w pliku IL2CPU</title>
<link>https://forum.pasja-informatyki.pl/586242/blad-w-pliku-il2cpu</link>
<description>

&lt;p&gt;Kilka dni temu zacząłem pisać system operacyjny w Cosmosie. Dzisiaj wyskoczył oto ten problem:
&lt;br&gt;
&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
Ważność	Kod	Opis	Projekt	Plik	Wiersz	Stan pominięcia
Błąd		Exception: System.Exception:	SKSOS	C:\...\source\repos\SKSOS\IL2CPU	1	
&lt;/pre&gt;



&lt;p&gt;Wyskoczył podczas debugu projektu. Tworzyłem też inne projekt w Cosmosie dzisiaj(te domyślne) aby sprawdzić czy to nie problem z moją instalacją Cosmosa, ale te domyślne projekty działały. Zmieniałem tylko kod w Kernel.cs&lt;/p&gt;



&lt;p&gt;Kod z Kernel.cs:
&lt;br&gt;
&amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
using Cosmos.System.FileSystem.VFS;
using System;
using System.Collections.Generic;
using System.IO;
using Sys = Cosmos.System;

namespace SKSOS
{
    public class Kernel : Sys.Kernel
    {
        private static string currentDirectory;
        private static string usersDirectory = &quot;/usersfiles&quot;;

        protected override void BeforeRun()
        {
            var fs = new Sys.FileSystem.CosmosVFS();
            Sys.FileSystem.VFS.VFSManager.RegisterVFS(fs);

            currentDirectory = usersDirectory;
            Console.WriteLine(&quot;SKSOS [Version 1.0]&quot;);
            Console.WriteLine(&quot;-------------------&quot;);
        }

        protected override void Run()
        {
            DOSManager();
        }

        public static void DOSManager()
        {
            Console.Write($&quot;{currentDirectory}&amp;gt; &quot;);
            var dosinput = Console.ReadLine();

            if (dosinput.StartsWith(&quot;print &quot;))
            {
                string result = dosinput.Substring(6);
                Console.WriteLine(result);
            }
            else if (dosinput.StartsWith(&quot;read &quot;))
            {
                string fileName = dosinput.Substring(5);
                string filePath = GetFilePath(fileName);

                try
                {
                    if (FileExists(filePath))
                    {
                        string fileContent = File.ReadAllText(filePath);
                        Console.WriteLine(fileContent);
                    }
                    else
                    {
                        Console.WriteLine(&quot;File not found: &quot; + fileName);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(&quot;Error reading file: &quot; + ex.Message);
                }
            }
            else if (dosinput.StartsWith(&quot;write &quot;))
            {
                int index = dosinput.IndexOf(' ', 6);

                if (index != -1)
                {
                    string fileName = dosinput.Substring(6, index - 6);
                    string filePath = GetFilePath(fileName);
                    string content = dosinput.Substring(index + 1);

                    if (CanWriteToDirectory(usersDirectory))
                    {
                        try
                        {
                            File.WriteAllText(filePath, content);
                            Console.WriteLine(&quot;File written successfully.&quot;);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(&quot;Error writing file: &quot; + ex.Message);
                        }
                    }
                    else
                    {
                        Console.WriteLine(&quot;No write permissions for the directory: &quot; + usersDirectory);
                    }
                }
            }
            else if (dosinput.StartsWith(&quot;del &quot;))
            {
                string fileName = dosinput.Substring(4);
                string filePath = GetFilePath(fileName);

                try
                {
                    if (FileExists(filePath))
                    {
                        File.Delete(filePath);
                        Console.WriteLine(&quot;File deleted successfully.&quot;);
                    }
                    else
                    {
                        Console.WriteLine(&quot;File not found: &quot; + fileName);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(&quot;Error deleting file: &quot; + ex.Message);
                }
            }
            else if (dosinput == &quot;cd ..&quot;)
            {
                // Przejdź do nadrzędnego katalogu
                int lastSlashIndex = currentDirectory.LastIndexOf('/');
                if (lastSlashIndex != -1)
                {
                    currentDirectory = currentDirectory.Substring(0, lastSlashIndex);
                }
            }
            else if (dosinput.StartsWith(&quot;cd &quot;))
            {
                string directoryPath = dosinput.Substring(3);

                if (directoryPath == &quot;..&quot;)
                {
                    // Przejdź do nadrzędnego katalogu
                    int lastSlashIndex = currentDirectory.LastIndexOf('/');
                    if (lastSlashIndex != -1)
                    {
                        currentDirectory = currentDirectory.Substring(0, lastSlashIndex);
                    }
                }
                else
                {
                    string newDirectory = Path.Combine(currentDirectory, directoryPath);

                    if (DirectoryExists(newDirectory))
                    {
                        currentDirectory = newDirectory;
                    }
                    else
                    {
                        Console.WriteLine(&quot;Directory not found: &quot; + directoryPath);
                    }
                }
            }
            else if (dosinput == &quot;clear&quot;)
            {
                Console.Clear();
                Console.WriteLine(&quot;SKSOS [Version 1.0]&quot;);
                Console.WriteLine(&quot;-------------------&quot;);
            }
            else if (dosinput == &quot;hi&quot; || dosinput == &quot;Hi&quot;)
            {
                Console.WriteLine(&quot;Hi!&quot;);
            }
        }

        private static bool FileExists(string filePath)
        {
            return File.Exists(filePath);
        }

        private static bool DirectoryExists(string directoryPath)
        {
            return Directory.Exists(directoryPath);
        }

        private static bool CanWriteToDirectory(string directoryPath)
        {
            try
            {
                // Sprawdź atrybuty katalogu
                var directoryAttributes = File.GetAttributes(directoryPath);
                var isReadOnly = (directoryAttributes &amp;amp; FileAttributes.ReadOnly) == FileAttributes.ReadOnly;
                return !isReadOnly;
            }
            catch
            {
                return false;
            }
        }

        private static string GetFilePath(string fileName)
        {
            return Path.Combine(currentDirectory, fileName);
        }
    }
}

&lt;/pre&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/586242/blad-w-pliku-il2cpu</guid>
<pubDate>Fri, 30 Jun 2023 04:41:31 +0000</pubDate>
</item>
<item>
<title>combobox i przypisana wartość do labela ?</title>
<link>https://forum.pasja-informatyki.pl/586158/combobox-i-przypisana-wartosc-do-labela</link>
<description>

&lt;p&gt;Witam! Pewno to banał ale nie mogę sobie poradzić z pewnym zadaniem. Mam combobox przykładowo z kolorami po angielsku i po wybraniu chcę żeby się on pojawiał w labelu po polsku - czyli inna, ale przyporządkowana wartość w labelu. Teraz mam tylko tyle że ta sama nazwa pojawia się w labelu. Jak to zmienić ?&lt;/p&gt;



&lt;pre class=&quot;brush:csharp;&quot;&gt;
namespace WindowsFormsApp26
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            comboBox1.Items.Add(&quot;White&quot;);
            comboBox1.Items.Add(&quot;Red&quot;);
            comboBox1.Items.Add(&quot;Black&quot;);   
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string nazwa = comboBox1.Text;
            lb.Text = nazwa;
        }
    }
}&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/586158/combobox-i-przypisana-wartosc-do-labela</guid>
<pubDate>Sat, 24 Jun 2023 21:05:33 +0000</pubDate>
</item>
<item>
<title>zapisanie liczb c#</title>
<link>https://forum.pasja-informatyki.pl/585600/zapisanie-liczb-c%23</link>
<description>taki nietypowy problem jak zapisać liczbę z dokładnością do większej ilości liczb po przecinku niż 15 bo potrzebuje (tak naprawdę to tylko chce i w ogóle nie potrzebuje) mieć dużą dokładność a zmienna double pozwala jedynie na te 15 cyfr po przecinku</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/585600/zapisanie-liczb-c%23</guid>
<pubDate>Wed, 07 Jun 2023 18:17:18 +0000</pubDate>
</item>
<item>
<title>Synchronizacja plików (Wspólna edycja)  C# Winforms</title>
<link>https://forum.pasja-informatyki.pl/585008/synchronizacja-plikow-wspolna-edycja-c%23-winforms</link>
<description>Hej, Chcę zbudować program, którego założenie jest proste: ma działał coś jak live share czyli mamy textbox1, który wyświetla tekst pliku plik1.txt no i teraz chce aby po uruchomieniu 2 razy tego programu można było &amp;quot;na żywo edytować plik&amp;quot; czyli edytuje w jednym oknie widzę w drugim edytuję w drugim widzę w pierwszym czyli klasycznie zapis odczyt itp itd. problem pojawia się w tym, że próbuję się do tego zabrać od miesięcy i nie mam pojęcia jak zgrać ze sobą zapis odczyt i to wszystko aby uniknąć: Problemów z zbieganiem się zapisu z odczytem oraz zbiegania się edycji pola tekstowego z wczytywaniem pliku ponadto problemy z uciekaniem kursora na początek itp itd&lt;br /&gt;
Wiem że pewnie źle to wytłumaczyłem ale chodzi mi o to że chce zrobić coś w stylu prosty live share taki jak np vs2022 czy vscode ma tylko, że całkowicie na jednej jednostce (komputerze) i na jednym pliku.</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/585008/synchronizacja-plikow-wspolna-edycja-c%23-winforms</guid>
<pubDate>Fri, 19 May 2023 15:04:27 +0000</pubDate>
</item>
<item>
<title>okno z poleceniem sql ?</title>
<link>https://forum.pasja-informatyki.pl/584832/okno-z-poleceniem-sql</link>
<description>

&lt;p&gt;Cześć Wszystkim! Zaczynam dopiero zabawę z C#. Mam takie pytanie chciałem zrobić pod C# takie coś... dwa okna, jedno do wyświetlania - DataGridView a drugie do wpisywania polecenia - RichBox i przycisk Show.&lt;/p&gt;



&lt;p&gt;Tak żeby po wpisywaniu polecenia sql np. &quot;select * from table1&quot; w RichBox i kliknięciu Show przefiltrowane dane pojawiały się w DataGridView.&lt;/p&gt;



&lt;p&gt;Napisałem coś takiego ale wywala mi błąd:&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
public partial class Form1 : Form
    {
        MySqlConnection con = new MySqlConnection(&quot;SERVER=localhost; DATABASE=baza ; UID = root ; PASSWORD=root;&quot;);
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string poleceniesql = richTextBox1.Text;
            MySqlDataAdapter da = new MySqlDataAdapter(poleceniesql, con);
            DataSet ds = new DataSet();
            da.Fill(ds);
            dataGridView1.DataSource = ds.Tables[0];
        }
    }&lt;/pre&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://forum.pasja-informatyki.pl/?qa=blob&amp;amp;qa_blobid=15278701961646037196&quot; style=&quot;height:241px; width:400px&quot;&gt;&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/584832/okno-z-poleceniem-sql</guid>
<pubDate>Sun, 14 May 2023 15:57:09 +0000</pubDate>
</item>
<item>
<title>Gdzieś jest błąd przy switch case ?</title>
<link>https://forum.pasja-informatyki.pl/584715/gdzies-jest-blad-przy-switch-case</link>
<description>

&lt;p&gt;Witam! Na &quot;ifach&quot; mi to działa ale chciałbym dla testu zrobić na switch case i już nie działa. Dwie funkcje jedna wywołuje drugą (tak potrzebuję). Mam trzy radioButtony i gdy wybiorę któryś z nich i kliknę button to w textBox nie pokazuje mi który został włączony. Gdzieś zrobiłem błąd...&lt;/p&gt;



&lt;p&gt;Działający na &quot;ifach&quot;:&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
namespace TwoFunction
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            liczenie();
        }

        public void liczenie() //cały kod 
        {
            string[] zmienna = new string[] { &quot;rB1&quot;, &quot;rB2&quot;, &quot;rB3&quot; };

            if (radioButton1.Checked)
            {
                textBox1.Text = zmienna[0];
            }

            else if (radioButton2.Checked)
            {
                textBox1.Text = zmienna[1];
            }

            else if (radioButton3.Checked)
            {
                textBox1.Text = zmienna[2];
            }
        }
    }
}&lt;/pre&gt;



&lt;p&gt;Nie działający switch case:&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
namespace TwoFunction
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            liczenie();
        }

        public void liczenie() //cały kod 
        {

            string[] zmienna = new string[] { &quot;rB1&quot; , &quot;rB2&quot;, &quot;rB3&quot; };

            RadioButton radioBtn = new RadioButton();
            if (radioBtn.Enabled == true)
            {
                switch (radioBtn.Name)
                {
                    case &quot;radioButton1&quot;:
                        textBox1.Text = zmienna[0];
                        break;

                    case &quot;radioButton2&quot;:
                        textBox1.Text = zmienna[1];
                        break;

                    case &quot;radioButton3&quot;:
                        textBox1.Text = zmienna[2];
                        break;
                }
            }
        }
    }
}&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/584715/gdzies-jest-blad-przy-switch-case</guid>
<pubDate>Thu, 11 May 2023 08:04:22 +0000</pubDate>
</item>
<item>
<title>Odczytanie adresu MAC z Windows CE</title>
<link>https://forum.pasja-informatyki.pl/584674/odczytanie-adresu-mac-z-windows-ce</link>
<description>Potrzebuje odczytać adres mac z urządzenia, który chodzi na Windows Embedded Compact 7. Jestem w stanie uzyskać adres naokoło czyli generując plik .txt ipconfigg /all a następnie odczytać z niego, natomiast chciałbym wyłącznie programowo wpisać do np do stringa.</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/584674/odczytanie-adresu-mac-z-windows-ce</guid>
<pubDate>Tue, 09 May 2023 18:14:07 +0000</pubDate>
</item>
<item>
<title>Zmiana radioButtona = zmian polecenia do bazy ?</title>
<link>https://forum.pasja-informatyki.pl/584659/zmiana-radiobuttona-zmian-polecenia-do-bazy</link>
<description>

&lt;p&gt;Witam! Jak na podstawie tego który radioButton został wybrany zmienić zapytanie select do&amp;nbsp;bazy danych?&amp;nbsp;&lt;/p&gt;



&lt;p&gt;np.&amp;nbsp;&lt;/p&gt;



&lt;p&gt;włączony radioButoton1&amp;nbsp; -&amp;gt;&amp;nbsp; string sql = &quot;SELECT * FROM tabela1 &quot;;&lt;/p&gt;



&lt;p&gt;włączony radioButoton2&amp;nbsp; -&amp;gt;&amp;nbsp;string sql = &quot;SELECT * FROM tabela2&amp;nbsp;&quot;;&lt;/p&gt;



&lt;p&gt;Połączenie mam:&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
private void button1_Click_1(object sender, EventArgs e)
        {          
            string sql = &quot;SELECT * FROM tabela1&quot;

            /// MySqlConnection conDataBase = new MySqlConnection(con);
            MySqlCommand cmdDatabase = new MySqlCommand(sql, con);
            MySqlDataReader myReader;
            //textBox6.Text = timeQuery;
            try
            {
                con.Open();
                myReader = cmdDatabase.ExecuteReader();
                while (myReader.Read())
                {
                   
                    tu jakies polecenia
                }
               
                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                con.Close();
            }
            
        }&lt;/pre&gt;



&lt;p&gt;nie wiem czy poprawny if też:&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
void wybierz()  
        {
            if (radioButton1.Checked)
            {
                string sql = &quot;SELECT * FROM tabela1 &quot;;

            }
            else if (radioButton2.Checked)
            {
                string sql = &quot;SELECT * FROM tabela2 &quot;;
            }

            else if (radioButton3.Checked)
            {
                string sql = &quot;SELECT * FROM tabela3 &quot;;
            }
            
        }&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/584659/zmiana-radiobuttona-zmian-polecenia-do-bazy</guid>
<pubDate>Tue, 09 May 2023 12:48:59 +0000</pubDate>
</item>
<item>
<title>Jak na podstawie nr_seryjny w tabeli device przypisywać id_u w tabeli value?</title>
<link>https://forum.pasja-informatyki.pl/584647/jak-na-podstawie-nr_seryjny-w-tabeli-device-przypisywac-id_u-w-tabeli-value</link>
<description>

&lt;p&gt;Jak na podstawie nr_seryjny w tabeli device przypisywać id_u w tabeli value?&lt;/p&gt;



&lt;p&gt;Mam dwie tabelki. Do tabelki device wpisuje &quot;ręcznie&quot; urządzenia które będą odczytywać dane. &amp;nbsp;Tabelka value to wartości automatycznie pobierane z urządzeń co godzinę. (Nr seryjny nie mogę dać jako klucz główny bo nie jest to wartość int, a szkoda bo ułatwiło by mi to sprawę).I teraz:&amp;nbsp;komputer&amp;nbsp;wysyła mi nr_seryjny urządzeń device, oraz wartości&amp;nbsp;do value w sposób automatyczny co godzinę. Jak napisać kod aby nr id_u (z device) wpisywał mi do id_u (w value) w spoób automatyczny na podstawie nr_seryjnego. Trudno to wytłumaczyć:) Niestety nigdy nie miałęm sytaucji że dane są pobierane automatycznie. Gdyby nr_seryjny był int i nie powtarzalny to nie było by problemu bo bym od niego zrobił klucz obcy.&amp;nbsp;&lt;/p&gt;



&lt;p&gt;Dodawanie&amp;nbsp; do devicezrobiłem:&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
{
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string connection = &quot;datasource=localhost;port=3306;username=root;password=&quot;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string iQuery = &quot;Insert into device (id_u, nr_seryjny, dane_1, dane_2, dane_3) values ('&quot; + this.textBoxid_u.Text + &quot;', '&quot; + this.textBoxnr_seryjny.Text + &quot;', '&quot; + this.textBoxdane_1.Text + &quot;', '&quot; + this.textBoxdane_2.Text + &quot;', '&quot; + this.textBoxdane_3.Text + &quot;');&quot;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MySqlConnection dataBase = new MySqlConnection(connection);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MySqlCommand cmd = new MySqlCommand(iQuery, dataBase);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MySqlDataReader r;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dataBase.Open();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; r = cmd.ExecuteReader();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(&quot;Wartosc zostala dodana&quot;); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch(Exception ex)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(ex.Message);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;



&lt;p&gt;Nie wiem jak przyporządkować wartość id_u&amp;nbsp;(do value- klucz obcy) na podstawie numeru seryjnego:/&lt;/p&gt;



&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://forum.pasja-informatyki.pl/?qa=blob&amp;amp;qa_blobid=15095060304446732887&quot; style=&quot;height:165px; width:500px&quot;&gt;&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/584647/jak-na-podstawie-nr_seryjny-w-tabeli-device-przypisywac-id_u-w-tabeli-value</guid>
<pubDate>Tue, 09 May 2023 10:07:01 +0000</pubDate>
</item>
<item>
<title>Jak zmienić background na image ?</title>
<link>https://forum.pasja-informatyki.pl/584303/jak-zmienic-background-na-image</link>
<description>

&lt;p&gt;Witam. Miałem&amp;nbsp;taki kod do zmiany koloru panelu po kliknięciu:&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
private void button2_Click(object sender, EventArgs e)
        {
            {
                if (button2.Text == &quot;WŁĄCZ&quot;)
                {
                    panel1.BackColor = Color.LimeGreen;
                    button2.Text = &quot;WYŁĄCZ&quot;;
                    
                }

                else if (button2.Text == &quot;WYŁĄCZ&quot;)
                {
                    panel1.BackColor = Color.Red;
                    button2.Text = &quot;WŁĄCZ&quot;;
                }
            }
        }&lt;/pre&gt;



&lt;p&gt;Chciałem go tak zmodyfikować aby button się zmieniał (nie panel) na inny backgroundimage po kliknięciu, a następnie zmienił się z powrotem po drugim kliknięciu. Wykombinowałem tylko:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;



&lt;pre class=&quot;brush:plain;&quot;&gt;
private void button2_Click(object sender, EventArgs e)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (button2.Text == &quot;WŁĄCZ&quot;)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button2.BackgroundImage = Properties.Resources.myOff;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button2.Text = &quot;WYŁĄCZ&quot;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else if (button2.Text == &quot;WYŁĄCZ&quot;)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button2.BackgroundImage = Properties.Resources.myOn;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button2.Text = &quot;WŁĄCZ&quot;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;



&lt;p&gt;ale nie wiem co ma być w &quot;if&quot; i jak się pozbyć &quot;button2.Text&quot; żeby nie było napisów prócz obrazka?&lt;/p&gt;



&lt;p&gt;Pewno jakaś drobnostka ale nie wiem :/&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/584303/jak-zmienic-background-na-image</guid>
<pubDate>Fri, 28 Apr 2023 11:48:01 +0000</pubDate>
</item>
<item>
<title>testowanie gier</title>
<link>https://forum.pasja-informatyki.pl/584112/testowanie-gier</link>
<description>witam, na jakiej platformie lub w jakim programie najlepiej testować już gotowe gry waszym zdaniem ?&lt;br /&gt;
zależy mi na tym żeby była bezpłatna lub tania .&lt;br /&gt;
pozdrawiam wasz młodszy kolega</description>
<category>C#</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/584112/testowanie-gier</guid>
<pubDate>Sun, 23 Apr 2023 15:46:24 +0000</pubDate>
</item>
</channel>
</rss>