[Solved] How do I email the stringbuilder class output using C# [closed]

Thanks Vladimir Arustamian for the research pointer…this is my solution… StringBuilder errMsg = new StringBuilder(); errMsg.AppendLine(); errMsg.AppendLine(“*************************”); errMsg.AppendLine(“TimeStamp: ” + System.DateTime.Now.ToString()); errMsg.AppendLine(errorMessage); errMsg.AppendLine(“*************************”); sw.WriteLine(errMsg.ToString()); System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.To.Add(System.Configuration.ConfigurationManager.AppSettings[“siteAdmin”]); message.Subject = “Failure”; message.From = new System.Net.Mail.MailAddress(“[email protected]”); message.Body = errMsg.ToString(); System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(“smtp.support.com”); smtp.Send(message); solved How do I email the stringbuilder class output … Read more

[Solved] c# how to teleport to where I want

You don’t give very much information in your question, but from your code I’m assuming the following: You’re using Unity3D You have a text input control that allows the user to enter commands. Your if-else block cycles through all possible commands and completes the required action. In this case, you are wanting to teleport to … Read more

[Solved] replace string by index of this string [closed]

You could use Regex.Replace(String, String, Int32) for this, execute until all of the intended replacements from arr are replaced. var text = File.ReadAllText(“file.txt”); var arr = new[] { “A”, “B”, “A” }; var regex = new Regex(“b”); for(int i = 0; i < arr.Count; i++) text = regex.Replace(text, arr[i].ToString(), 1); Tip: Never answer when tired… … Read more

[Solved] how to control one program from other

Well, your starting sentence was: “I have seen trainers for games which can set health of player and spawn cars etc. I want to make something similar to that.” Here’s a very nice reference code that does what you talked about in C++ http://www.codeproject.com/Articles/7468/Game-Wizard First strengthen your C++ skills and then study what he does … Read more

[Solved] Header functions

Assuming that “didn’t work” means “didn’t affect the ScreenArray in my MonitorArray“, it’s because getScreen returns a copy of the array element ScreenArray MonitorArray::getScreen(int arrayPointer) while the new member function most likely works with the array directly. You’ll need to return a pointer to the array element instead: ScreenArray* MonitorArray::getScreen(int arrayPointer) { if (arrayPointer<0 || … Read more

[Solved] Is it possible to run scanf like this? [closed]

I think this is what you are trying to do: int main() { int numList[5]; int i; for(i = 0; i < 5; i++) { printf(“Input number %d “,i); scanf(“%d”,&a[i]); } printf(“Your numbers: “); for(i = 0; i < 5; i++) { printf(“%d, “,a[i]); } printf(“\n”); } The method that I used for printing is … Read more