windows-applications

Saving Controls in C# Windows Application

若如初见. 提交于 2019-12-25 06:29:51
问题 I am creating an application that creates a list of buttons from video files. Each button is generated to open the file on click, and then I use an open api (omdb.com) to get the movie posters for each one. However, not only is doing this process each time you launch the application slow, but it is also an unnecessary load on the website. What is the most efficient way to save a control after it is dynamically generated in the backend. So far I have tried using Properties.Settings , but

Select element within StackPanel by index C# XAML

て烟熏妆下的殇ゞ 提交于 2019-12-25 04:04:29
问题 How can I select an element for manipulation by its Stackpanel index? Earlier on, this question has been asked, but the solution does not work in window applications, but only in Universal Windows Applications. 回答1: You can access the Children property. It returns a property with an indexer that you can access with an index. The following sample contains two TextBlocks in a StackPanel and sets the text of the second one to another value in the constructor: XAML: <Window x:Class="TestWPF

windows form GUI gets freezed when calling the thread from the while loop. How to make Gui responsive?

此生再无相见时 提交于 2019-12-25 03:55:38
问题 class ... { onClick() { while(true) { //call the thread from here threadpool(request)//send request to thread using thread pool } } //the function for thread threadfunction()//function that thread calls { // I am not able to change the textbox/datagridview in windowsform from here the main ui gets stuck // } } I dont want to change the above logic is it possible to update datagrid simaltaneously from function for thread because my program just get stuck. 回答1: The while (true) should be inside

ExecuteNonQuery() Not Working

徘徊边缘 提交于 2019-12-25 00:28:27
问题 Referring post : C# - ExecuteNonQuery() isn't working with SQL Server CE I have the same problem with an attached Access Database to my Project and indeed i try to Insert records but all in vain, it tells me that it's inserted but no records found.. Well the above post discussed the problem and its cause but i want to know more about the solution... How Can i Solve this problem??? Best Regards, Baher. 回答1: I think I found out the Solution , after searching for sometime i did the following

Twilio - Making a call from .NET Windows application to a Phone

余生长醉 提交于 2019-12-24 17:44:13
问题 I am trying to write a windows application to call a phone number(Twilio verified) from my application directly. What i was able to achieve was: - To call a phone number and read out a voice sms as mentioned in the TWIML url. - to call a phone number and then redirect it to another phone number ( by using in the TwiML). But what i want to do now is: - Call a phone number directly from the application using my Headphones attached to the pc where the app is running. Is there a way to do that?

Parsing icon for applications issue

China☆狼群 提交于 2019-12-24 06:59:06
问题 I want to get applications icon from the registry. The problem is that I'm getting only default application icon. How to get the actual application icon? Thanks. Screenshot: Code: QStringList allLocalMachineX86Keys; QString displayIcon; QString iconFile; QIcon programIcon; QStringList displayIconSplitted; QString iconSplittedData; QFileIconProvider fileIconProvider; QString displayName; QSettings registryKeyLocalMachineX86("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\

Parsing icon for applications issue

こ雲淡風輕ζ 提交于 2019-12-24 06:59:06
问题 I want to get applications icon from the registry. The problem is that I'm getting only default application icon. How to get the actual application icon? Thanks. Screenshot: Code: QStringList allLocalMachineX86Keys; QString displayIcon; QString iconFile; QIcon programIcon; QStringList displayIconSplitted; QString iconSplittedData; QFileIconProvider fileIconProvider; QString displayName; QSettings registryKeyLocalMachineX86("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\

How to get IPv4 and IPv6 address of local machine?

倾然丶 夕夏残阳落幕 提交于 2019-12-23 12:47:29
问题 I am developing a windows application and I need to find the IPv4 and IPv6 address of local machine. OS can be XP or Windows 7. I got a solution for getting MAC address like, string GetMACAddress() { var macAddr = ( from nic in NetworkInterface.GetAllNetworkInterfaces() where nic.OperationalStatus == OperationalStatus.Up select nic.GetPhysicalAddress().ToString() ).FirstOrDefault(); return macAddr.ToString(); } This is working in all OS. What is the correct way to get IPv4 and IPv6 address

How to read the text file from the Application Directory text file

久未见 提交于 2019-12-23 04:08:36
问题 I have a text file in the application project classpath Directory of Windows Form Application. Now at the time of installation I am trying to write a text value into the text file. Here is my Installer class code for text file.. File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\" + "ConnectionString.txt",param3); After installation I want to retrieve the text that is entered in the "ConnectionString.txt" file and use it in the application but I am not getting how to retrieve the

How to get OS version and Device Name of an Android device connected via USB with C#.net (VS2010/4.0+)?

心已入冬 提交于 2019-12-22 10:05:31
问题 I want to build a windows application in C#.net which should identify the installed Adroid OS version (e.g. 4.0) and user friendly Device Name (e.g. Samsung Galaxy S3, Samsung Galaxy Tab 8.9 etc.) when you connect an Android device to your computer via USB. I tried with the System.Management class to identify the connected USB devices on my machine, however, the problems I had were: I just have 3 USB ports and connected the Samsung Galaxy Tab 8.9 on one of the USB ports and tried to get the