Click here to Skip to main content
15,887,821 members
Home / Discussions / C#
   

C#

 
Question[Solved] Safe way to insert USB-drive. Pin
Acuena1-Nov-19 5:48
Acuena1-Nov-19 5:48 
AnswerRe: Safe way to insert USB-drive. Pin
Richard Deeming1-Nov-19 6:27
mveRichard Deeming1-Nov-19 6:27 
GeneralRe: Safe way to insert USB-drive. Pin
Acuena1-Nov-19 12:38
Acuena1-Nov-19 12:38 
AnswerRe: Safe way to insert USB-drive. Pin
OriginalGriff1-Nov-19 6:43
mveOriginalGriff1-Nov-19 6:43 
GeneralRe: Safe way to insert USB-drive. Pin
Acuena1-Nov-19 12:38
Acuena1-Nov-19 12:38 
GeneralRe: Safe way to insert USB-drive. Pin
OriginalGriff1-Nov-19 12:44
mveOriginalGriff1-Nov-19 12:44 
QuestionUse From that's in a class library, from other programs Pin
Lupu5R3x1-Nov-19 1:46
Lupu5R3x1-Nov-19 1:46 
AnswerRe: Use From that's in a class library, from other programs Pin
Afzaal Ahmad Zeeshan1-Nov-19 2:09
professionalAfzaal Ahmad Zeeshan1-Nov-19 2:09 
Quote:
The form is in a class library, course I want to use it in several programs.
Why not just keep the controls in the library and access the controls in the Windows Forms application? That would solve almost all of your problems.
Quote:
I want to use the library to handle the main programs license.
Library cannot do anything on its own. Yes, you can contain the code for the logic in the library, but it would be your own application that triggers the functions and calls them to process something. Using a library, you will still need to process the output of the functions and then either continue the program, or terminate the process—as per licensing and other requirements.

There are a couple of articles on software licensing on CodeProject (search in top right corner), in case you want to see how to apply these features in a software application.
Quote:
"pop" the form to allow the user to enter User Name and License.
Seems like a flow, why not execute the Windows Forms process itself, and "pop" it so user can input the details. This will be helpful, you can use Process class to start the process, and handle the output manually. If this program of yours is a Windows Forms app, then you can simply create the instance of the Form and show it.

Process Class (System.Diagnostics) | Microsoft Docs

To make things even interesting, you can add the Form elements to your console program, and show it dynamically on the runtime, see this thread for more, How to: Create a Windows Forms application from the command line | Microsoft Docs
Form Class (System.Windows.Forms) | Microsoft Docs
Quote:
When the user clicks the form button
This would be managed inside the Windows Forms app, and your program will not do anything in this aspect—it will keep listening to the updates from licensing library.

Event driven programming in C# will help you in this case, Events - C# Programming Guide | Microsoft Docs

Based on the response of the library using the event, you can handle how to proceed with the last logic you have.

Once again, this is just pseudo-code, since you shared the pseudo-attempt with us. Start with the points I shared and get back to us, we will have more support by then.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~

GeneralRe: Use From that's in a class library, from other programs Pin
Lupu5R3x1-Nov-19 3:52
Lupu5R3x1-Nov-19 3:52 
QuestionDatagrid Cell content to only visible rows Pin
Member 135108471-Nov-19 0:01
Member 135108471-Nov-19 0:01 
AnswerRe: Datagrid Cell content to only visible rows Pin
Richard Deeming1-Nov-19 1:33
mveRichard Deeming1-Nov-19 1:33 
GeneralRe: Datagrid Cell content to only visible rows Pin
Member 135108471-Nov-19 18:47
Member 135108471-Nov-19 18:47 
GeneralRe: Datagrid Cell content to only visible rows Pin
Richard Deeming3-Nov-19 22:12
mveRichard Deeming3-Nov-19 22:12 
AnswerRe: Datagrid Cell content to only visible rows Pin
Dave Kreskowiak1-Nov-19 1:50
mveDave Kreskowiak1-Nov-19 1:50 
GeneralRe: Datagrid Cell content to only visible rows Pin
Member 135108471-Nov-19 18:50
Member 135108471-Nov-19 18:50 
GeneralRe: Datagrid Cell content to only visible rows Pin
Member 135108471-Nov-19 23:11
Member 135108471-Nov-19 23:11 
GeneralRe: Datagrid Cell content to only visible rows Pin
Dave Kreskowiak2-Nov-19 3:38
mveDave Kreskowiak2-Nov-19 3:38 
QuestionC# Sql calling function - SELECT from two diffrent Sql folders Pin
Member 1464122431-Oct-19 21:22
Member 1464122431-Oct-19 21:22 
AnswerRe: C# Sql calling function - SELECT from two diffrent Sql folders Pin
OriginalGriff31-Oct-19 22:35
mveOriginalGriff31-Oct-19 22:35 
GeneralRe: C# Sql calling function - SELECT from two diffrent Sql folders Pin
Member 1464122431-Oct-19 22:51
Member 1464122431-Oct-19 22:51 
GeneralRe: C# Sql calling function - SELECT from two diffrent Sql folders Pin
OriginalGriff31-Oct-19 23:09
mveOriginalGriff31-Oct-19 23:09 
GeneralRe: C# Sql calling function - SELECT from two diffrent Sql folders Pin
Member 1464122431-Oct-19 23:14
Member 1464122431-Oct-19 23:14 
GeneralRe: C# Sql calling function - SELECT from two diffrent Sql folders Pin
OriginalGriff31-Oct-19 23:26
mveOriginalGriff31-Oct-19 23:26 
GeneralRe: C# Sql calling function - SELECT from two diffrent Sql folders Pin
Member 146412241-Nov-19 0:11
Member 146412241-Nov-19 0:11 
QuestionALPHA CHANNEL Pin
Member 1463438031-Oct-19 2:05
Member 1463438031-Oct-19 2:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.