[Solved] How to create a text file name with textbox value?

[ad_1] Thank U guys ,with all Your help I solved it private void button2_Click(object sender, EventArgs e) { button2.Text = “SAVE”; var files = Directory.GetFiles(@”C:\\Users\\Apple\\Desktop\\proj”).Length; string fileName = textBox1.Text.Substring(0, 3) + -+ ++files + “.txt”; string path2 = Path.GetFullPath(“C:\\Users\\Apple\\Desktop\\proj”); string docPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); string var = Path.Combine(docPath, path2); string var1 = Path.Combine(var, fileName); using (StreamWriter … Read more

[Solved] when passing non member variable data to a constructor how to save them and use then in other member functions ? C++ [closed]

[ad_1] Your two options are 1) Make them member variables 2) Add them as arguments to the print() function, as shown below, then call print within the constructor (if that is the intention) void CPOI::print(string name, double latitude , double longitude) If you pass them to the constructor, but they are not stored in member … Read more

[Solved] What is more Efficient? Implementation in overloaded function or by checking object type in Base class function

[ad_1] For many reasons – code maintainability, extensibility, concision, reliability, minimising the amount of code that needs to be recompiled/redistributed to pick up changes in some library code it uses – you should almost always use virtual functions rather that writing your own switching mechanisms. If you need to ask about it on stackoverflow, I’d … Read more

[Solved] C# How to get the start date of the current 12 month cycle given a start date and an end date for a period [closed]

[ad_1] You can get the date and month values for start date and the year value for end date and use it to set current start date: DateTime startDate = (Convert.ToDateTime(“02/02/2016”)); var dy = startDate.Day; var mn = startDate.Month; DateTime endDate = (Convert.ToDateTime(“18/04/2018”)); var yy = endDate.Year; var currentStartDate = new DateTime(yy, mn, dy); 3 … Read more

[Solved] GtkTreeView set selection to specific row

[ad_1] You don’t need to use a GtkTreeIter for this, the GtkTreePath API is enough. You’re throwing your path away before using it, which creates problems. Here’s how to do it: GtkTreePath *path = gtk_tree_path_new_from_indices(3, -1); gtk_tree_selection_select_path(treeview_selection, path); gtk_tree_path_free(path); UPDATE: I rewrote the code completely to drop use of GtkTreeIter, I originally thought that you … Read more

[Solved] Discord bot playing status

[ad_1] Try This: public class Help : ModuleBase<SocketCommandContext> { [Command(“test”)] public async Task TestAsync() { await Context.Client.SetGameAsync(“eating doritos”); await Task.CompletedTask; } } [ad_2] solved Discord bot playing status

[Solved] Problems changing variable in #if

[ad_1] Preprocessor directives are interpreted before compiling your program. So VAR has no knowledge of a and b. See C preprocessor on Wikipedia. Instead, you could create a macro that takes parameters, like this: #define VAR(a,b) (a | b) …and use it like that: #if (VAR(a,b) != 0) You would have to adapt your program, … Read more

[Solved] text on progressbar in c# [closed]

[ad_1] This works – although I’d set the thread-sleep to more than 200 ms. Your problem was that you did the work in the UI thread and this way it never gets updated. For better visibility, just change the font color: private void Form1_Load(object sender, EventArgs e) { Task t = new Task(() => StartUpdate()); … Read more

[Solved] Looking for explanation to argv[1][i] second array of pointers [duplicate]

[ad_1] If you call your executable, for instance, with one of these $ ./executable one foobar > program.exe one foobar You get argc == 3 argv[0] ==> “./executable” or “program.exe” argv[1] ==> “one” argv[2] ==> “foobar” argv[3] == NULL argv[2][0] == ‘f’ argv[2][1] == ‘o’ argv[2][2] == ‘o’ argv[2][3] == ‘b’ argv[2][4] == ‘a’ argv[2][5] … Read more