|
I am a student at WGU academy. The school is not bad for what it is considering price and goals. I am going for a bachelors in cybersecurity. I have no background experience in anything I.T. I have only ever been an automotive technician and fire sprinkler installer.
To start at the university, you need to have some prerequisites done at the academy to get accepted. 1 is English composition 101 and the other is Microsoft software development OR Microsoft database administration. I chose software development to learn c#.
On this class, there are 7 topics to pass.
Also on this class, you can access a forum where other students post their problems or solutions on the same course. In that forum, I noticed one of the topics were, "I have finished the 4th topic and still feel I don't know how to code alone without the examples."
With that said, I am on the third topic and am having trouble understanding some of the verbiage and what it means. I have tried Youtube videos and other means. any advice on where to learn better or where can I find better coding practices?
If you guys have any feedback on this school too, let me know.
second topic is all about object oriented programming. I am only having trouble with keywords like, "This", constructors, delegates and signatures.
|
|
|
|
|
You already have this posted in QA: do not post in multiple places - it duplicates work and that wastes our time and annoys people.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
IMO if you`re new to programming the best way to learn to make programs is to approach two programming languages at the same time (C++ and C# for example) and see the common ground they share (variables, functions, classes), after you have a good grasp of core concepts you can focus on the specifics one particular programming language.
|
|
|
|
|
I'd suspect that will confuse rather than educate - particularly with two languages that look so similar on the surface but are fundamentally different in the way they handle things.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
There`s little I can teach a veteran.
To my mind if you`re a theory first type person you find it easier to grab a book, learn the basic concepts and dive into applied code afterwards. But there`s also greasy hands first type people(like I am), they throw away the book and go about learning by dismanteling and putting stuff back together.
|
|
|
|
|
What IDE (e.g. Visual Studio) are you using? If VS, press F1 (help) when there's a (selected) keyword you're unsure about ... then read.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I suggest a book like SAMS Learn C# in 21 Days[^].
The link may not point to the most recent version of the book, so you will have to locate it.
This book series provides a set of lessons that teach you a language, one thing at a time, using live examples and practice coding. It's not going to teach you everything, but you can get a good handle on the language and major concepts. Depending on your level of understanding and how quickly you pick this up, each lesson will probably take 1 to 4 hours. Experienced people breeze through it much faster, but you have a lot of basic concepts to learn.
Unless you have 2 monitors or 2 computers, I recommend hard copy. You don't want to switch back-n-forth between the book and an IDE.
|
|
|
|
|
i am working in a small team and we develop winform application which our company people use it daily. our project is in VSTS means using TFVC.
we use click one publish feature to publish our application to a centralize office server and our colleagues install from there as a result when we give update then those update automatically download in client pc.
please discuss what will be best release management for our winform project. when we check-in any changes in TFVC then all changes goes to main branch that master branch. should we always work with master branch or always create new branch. if new branch then when we should create new branch?
please guide me with steps-by-step details that how could i follow any standard release management for our winform application.
Thanks
|
|
|
|
|
Quote: please guide me with steps-by-step details
Would you like lunch with that?
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Oh, yes please.
It's been ages since I went out for lunch.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Forum is place where knowledgeable people guide other. i have little knowledge on good strategy for release management and that is why asked here.
|
|
|
|
|
Mou_kol wrote: Forum is place where knowledgeable people guide other And that is perfectly correct - Gerry is just being a smartass (we all do it at some time).
Beware what you ask for, we found the automatic deployment scenario a PITA that needed a lot more care and management than a manual deployment. The senior developer (me) was the one to do/authorise the deployments after discussing/reviewing the changes. As the senior dev I was responsible for the health of the production environment (20+ applications), having my butt kicked for a junior devs stuff up was irritating.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Hi,
I have used DataGridView to my application. I have also added right click menu and some functions such as cell color and text color in it. How can I save cell and text color so when I re-open my application, my last settings to be loaded. I use SQL CE for read/write data from/into DataGridView.
Please guide me.
If possible, please provide a sample code for my question so I can study and find a solution for my own problem.
|
|
|
|
|
You already know how to set the colours, and getting them uses exactly the same properties.
So all you need to do is loop through your DGV rows and columns at form close time and save that info to a file - using whatever file format floats your boat: CSV, JSON, XML, ... any of them will do it.
Then at startup, you read the file, and copy the info back to your DGV.
What part of that is difficult for you?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I can loop through all cells in DataGridView using double For.
But, I don't know how to code in xml and how to read it when loading my app.
I need a sample code for reading/Writing xml for this purpose.
|
|
|
|
|
|
I tried to build a Write/Read class as follows:
class DataGridViewColor
{
public static void WriteDataGridViewSettings(System.Windows.Forms.DataGridView dgv)
{
XmlTextWriter writer = new XmlTextWriter(Application.StartupPath + @"\MyGridColor.xml", null);
writer.WriteStartDocument();
writer.WriteStartElement(dgv.Name);
int LastRow = dgv.Rows.Count-1;
for (int i = 0; i < LastRow; i++)
{
for (int j = 0; j < dgv.Columns.Count - 1; j++)
{
writer.WriteStartElement("Color");
writer.WriteStartElement("CellColor");
writer.WriteString(dgv.Rows[i].Cells[j].Style.BackColor.ToString());
writer.WriteEndElement();
writer.WriteStartElement("TextColor");
writer.WriteString(dgv.Rows[i].Cells[j].Style.ForeColor.ToString());
writer.WriteEndElement();
writer.WriteEndElement();
}
}
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();
}
}
Now, I need to build a class for reading but I don't know how to do that.
Please guide me by giving a code so I can learn something about the solution.
I tried this code but it gives error:
class DataGridViewColor
{
public static void ReadDataGridViewSettings(System.Windows.Forms.DataGridView dgv)
{
XmlDocument xmldoc = new XmlDocument();
XmlNodeList xmlnode;
FileStream fs = new FileStream(Application.StartupPath + @"\MyGridColor.xml", FileMode.Open, FileAccess.Read);
xmldoc.Load(fs);
xmlnode = xmldoc.GetElementsByTagName("column");
for (int i = 0; i <= (xmlnode.Count)/13; i++)
{
string cellcolor = xmlnode[i].ChildNodes.Item(0).InnerText.Trim();
string textcolor = xmlnode[i].ChildNodes.Item(1).InnerText.Trim();
for (int j = 0; j < 13; j++)
{
dgv.Rows[i].Cells[j].Style = new DataGridViewCellStyle {BackColor = Color.FromName(cellcolor)};
dgv.Rows[i].Cells[j].Style = new DataGridViewCellStyle {ForeColor = Color.FromName(textcolor)};
}
}
fs.Close();
}
}
modified 12-Jan-21 13:12pm.
|
|
|
|
|
please short I remember that when clicking in a cell that the corresponding date evening retrieve and store in a variable. I use a calendar layout like a tables or columns are dates and a column has several cells, I want when I click on a cell to get its corresponding date.
I program in c #
|
|
|
|
|
|
If you want to get an answer to get nearer to your goal you have to provide MUCH MORE information about your control and how it is working.
Of course ... there ist a solution ... but we can't see what you have done until now and we don't have any information about what you are doing ...
If you want to get help : help us ...!!!
|
|
|
|
|
I am fairly new to API's. I am writing a "simple" API that will convert .docx files to .pdf files and return the pdf's back to the client for saving. I have the code working for a single file but I wanted to code the API to handle multiple files in a single request. Now the API is not receiving the request. I can provide the working code with a single file if requested.
I am sure I am missing something simple. Please see below and see if anyone see's something that I could be doing better or why the API is not receiving the POST request.
Client:
List<string> documents = new List<string>();
private async void btnConvert_Click(object sender, EventArgs e)
{
using (var client = new HttpClient(new HttpClientHandler() { UseDefaultCredentials = true }))
{
client.BaseAddress = new Uri(BaseApiUrl);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, BaseApiUrl + ApiUrl);
foreach (string s in docPaths)
{
byte[] bte;
bte = File.ReadAllBytes(docPath);
string data = JsonConvert.SerializeObject(Convert.ToBase64String(bte));
documents.Add(data);
}
using (var formData = new MultipartFormDataContent())
{
foreach (string s in documents)
{
formData.Add(new StringContent(s, Encoding.UTF8, "application/json"));
}
var conversions = documents.Select(doc => client.PostAsync(BaseApiUrl + ApiUrl, formData)).ToList();
await Task.WhenAll(conversions);
var responses = conversions.Select
(
task => task.Result
);
foreach (var r in responses)
{
var s = await r.Content.ReadAsStringAsync();
SimpleResponse res = JsonConvert.DeserializeObject<SimpleResponse>(s);
if (res.Success)
{
byte[] pdf = Convert.FromBase64String(res.Result.ToString());
}
else
{
}
}
}
}
API: This is function that should get the request from the client but it's not being hit.
[HttpPost]
public async Task<List<SimpleResponse>> Post([FromBody]string request)
{
var response = new List<SimpleResponse>();
AIMSConverter convert = new AIMSConverter();
var provider = new MultipartMemoryStreamProvider();
await Request.Content.ReadAsMultipartAsync(provider);
foreach (var requestContents in provider.Contents)
{
try
{
}
catch (Exception ex)
{
response.Add(new SimpleResponse() { Success = false, Exception = ex, Errors = new List<string>() { string.Format("{0}, {1}", ex.Message, ex.InnerException?.Message ?? "") } });
}
}
return response;
}
SimpleResponse Model:
public class SimpleResponse
{
public object Result { get; set; }
public bool Success { get; set; }
public Exception Exception { get; set; }
public List<string> Errors { get; set; }
}
|
|
|
|
|
Rather than sending the file content as a Base64-encoded string, you need to send a multipart/form-data request.
You are currently building one request with all of the files attached, and then sending it multiple times - once for each file. You should only send the request once.
Client:
using (var formData = new MultipartFormDataContent())
{
foreach (string document in docPaths)
{
var fileInfo = new FileInfo(document);
var file = new StreamContent(fileInfo.OpenRead());
file.Headers.ContentLength = fileInfo.Length;
formData.Add(file);
}
var responses = await client.PostAsync(BaseApiUrl + ApiUrl, formData);
foreach (var r in responses)
{
... Server:
var provider = new MultipartMemoryStreamProvider();
await Request.Content.ReadAsMultipartAsync(provider);
foreach (MultipartFileData file in provider.FileData)
{
try
{
var result = convert.CovertDocToPDF(file, WebConfigurationManager.AppSettings["tempDocPath"], WebConfigurationManager.AppSettings["tempPdfPath"]);
response.Add(new SimpleResponse { Result = result, Success = true });
}
catch (Exception ex)
{
response.Add(new SimpleResponse { Success = false, Exception = ex, Errors = new List<string> { string.Format("{0}, {1}", ex.Message, ex.InnerException?.Message ?? "") } });
}
} Sending HTML Form Data in ASP.NET Web API: File Upload and Multipart MIME - ASP.NET 4.x | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Please I would like to have the C # winforms code, when we click on a cell to enter text it retrieves the corresponding date and stores in a variable
|
|
|
|
|
That's a really bad question. You're going to have to go into a lot more detail about the problem you're having.
"When we click on a cell..." What cell? What control is this? What text are you expecting to be entered?
Nobody is going to write the code for you.
|
|
|
|
|