[Solved] Const Auto/Identifier Errors [closed]

This is C++17 syntax. As this standard is not yet the default option for most compilers you have to tell the compiler that you are using it via the -std=c++17 switch. PS: you didn’t say which compiler you are using, so maybe it will not support that switch or not even support C++17 at all. … Read more

[Solved] Pull out replaceable fields from a string [closed]

static void Main(string[] args) { String str = “{dog} and the {cat}”; String[] ret = ExtractTagValue(str); } public static String[] ExtractTagValue(String input) { List<String> retLst = new List<string>(); String pattern = “(\\{.*?\\})”; System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(pattern); System.Text.RegularExpressions.MatchCollection matches = regex.Matches(input); if (matches.Count > 0) { foreach (Match match in matches) { retLst.Add(match.Value); } } … Read more

[Solved] Arrays In loops by C# [closed]

IMO, best will be to use a Dictionary<string,int[][]>. During creation you will place a new array (which you just created) and assosiate it to the key “a” + i. To get this array, just get the value attached to the relevant key. Something like (C#-like pseudo code): var map = new Dictionary<string,int[][]>(); for(int i=1;i<10;i++) { … Read more

[Solved] Upload an excel File to Database

Hi here i am using this to import from Excel File.Try this.Works 100%… Here you should have a folder inside your application named as “Files” where after uploading your excel file,it will be stored and your program will read from the excel file available inside “Files” Folder. protected void btnImport_Click(object sender, EventArgs e) { ArrayList … Read more

[Solved] Properties in C# advantage [duplicate]

From personal experience: You would generally have Private data member when you do not want it to be accessed externally through another class that calls the class containing the Private data member. Public data members are those that you can access by other classes to obtain its contents. My opinion is that it is simply … Read more

[Solved] C# Webservice to copy datas from one DB to Another [closed]

if an employee’s datas changed in HR database automatically FD system must notified to refresh his database Consider looking at SQL Server Replication (or) AlwaysOn feature for this same purpose. Specifically you should look at Transactional Replication 2 solved C# Webservice to copy datas from one DB to Another [closed]

[Solved] I can’t use a “kill” process in my code. (its underlined with red) [closed]

Lets make it very simple. Create a Process field and use it everywhere: private Process pNotepad; //Process field void sRecognize_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { if (e.Result.Text == “alice present”) { SoundPlayer sndPlayer = new SoundPlayer(Ai.Properties.Resources.My_name_is_A_L_I_C_E); sndPlayer.Play(); } if (e.Result.Text == “open notepad”) { //starting Process “notepad” pNotepad = new Process(); pNotepad.StartInfo.FileName = “notepad.exe”; pNotepad.Start(); } … Read more

[Solved] How do I read a line of 12 numbers from a file and store it into an array?

This should fix your problem. It will parse all rows and place each line in a string stream. It then parses the string stream and streams the elements into doubles. It should work for any combination of rows and column elements. #include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector> using namespace std; int … Read more

[Solved] How can I store a variable in another file?

You can use std::fstream: #include <fstream> #include <iostream> int myint; int main() { // when entering app: std::ifstream fs(“data.txt”); if ( fs ) { fs >> myint; } fs.close(); std::cout << myint; myint++; // when exiting app: std::ofstream fs2(“data.txt”); fs2 << myint; } 2 solved How can I store a variable in another file?

[Solved] Unique number in random?

public static void FisherYatesShuffle<T>(T[] array) { Random r = new Random(); for (int i = array.Length – 1; i > 0; i–) { int j = r.Next(0, i + 1); T temp = array[j]; array[j] = array[i]; array[i] = temp; } } int[] array = new int[10000]; for (int i = 0; i < array.Length; … Read more

[Solved] Winforms owner-drawn controls and resizing

Solved (for anyone else owner-drawing controls): protected override void WndProc(ref Message m) { const int WM_WINDOWPOSCHANGED = 0x0047; base.WndProc(ref m); if (m.Msg == WM_WINDOWPOSCHANGED) { //Make changes to your display rectangle here… this.PerformLayout(); } } solved Winforms owner-drawn controls and resizing