|
The normal way to work with multiple versions of the same codebase is to use a source control management system such as GIT[^].
This space for rent
|
|
|
|
|
Pete is absolutely right - GIT is the way to go.
You may find this helpful: Getting started with GIT, Visual Studio, and BitBucket[^] - most of it should be very similar for GitHub if you use that instead.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hello friends. I'm learning c # programming language. I want to do something. How do I delete a folder and subfolders by creating a loop.I would appreciate it if you could help.
|
|
|
|
|
|
You may also want to look into this thing called "recursion".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
This can be done entirely without recursion.
This space for rent
|
|
|
|
|
Pete O'Hanlon wrote: This can be done entirely without recursion. Cool. Got a link?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I don't want to give the OP the solution but the code relies on the fact that ```Directory.GetDirectories``` and ```Directory.GetFiles``` both allow you to return entries from subdirectories using ```SearchOptions```.
This space for rent
|
|
|
|
|
Thanks for the explanation
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Hi I am new to c# coding and I am having problems with some basic things I keep getting error codes CS1519,CS1031,CS8124
Console.writeline("Hello and welcome to the number guessing game!");
|
|
|
|
|
C# is a case sensitive language: which means that Console is not the same thing as console - and that applies to everything. UPPERCASE and lowercase characters are considered to be very different. If you create a variable called MyString then you can't use it by typing mystring , myString , Mystring , or any other variation.
In this case, your code is trying to call a method called WriteLine and the case sensitivity is catching you:
Console.WriteLine("Hello and welcome to the number guessing game!"); Should get rid of those errors.
But the error numbers you are getting implies there are a lot of other errors there, which we can't see - remember that we can't see your screen, access your HDD, or read your mind; we only get exactly what you type to work with - which are "forcing" error to come up on that line.
Chances are you need to look closely at the first line that an error is being reported on and see what the error message says as it may be causing other problems.
A valid C# file should look something like this:
using System;
using ... other namespaces being used ...
namespace MyNamespaceName
{
static class MyProgramName
{
static void Main()
{
...
}
}
} So if yours doesn't that may be a problem.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hello, I'm pretty new to C#, it is one of my subjects of my studies this semester, so thanks for beeing patient
I was trying to make the card game Black Jack for one of my assignments, but I have reached a problem which i don't know how to fix without getting a horribly long code.
I have put in a couple of picture boxes for the card pictures to load into, and when I Click the "Hit" button, I want the card that is choosen at random to be loaded into picbox1, next time i press it i want it to load to picbox2 and so on...
But I have no idea how to code the method to know which picbox to load into
here's a picture of my layout:
<"https://imgur.com/a/zbucNcB">
Sorry if I made any mistakes explaining, It's my first time posting here.
many thanks in advance for any help!
modified 4-Oct-18 17:11pm.
|
|
|
|
|
I would have collection of containers (pictureboxes) when you hit create a new container, add the card image and add the container to the collection.
Your UI should be able to display the collection of containers (listbox etc) rather than a limited number of containers.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you for your reply!! It's late here right now, but I'll read up on it tomorrow after lectures to see how it works!
|
|
|
|
|
1. keep a list of PictureBoxes.
2. use an integer counter variable as an index to the next PictureBox to be used.
3. reset the index when needed.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
in Common.c
typedef unsigned char UN_Char;
typedef enum { Valid = 0, Invalid = 1, Unknown = -999 } AppResponseCode;
Method in SomeApi.C , need to Call from C#
static AppResponseCode SomeFunction(UN_Char ** vUC1PtrPtr,size_t * vSize1Ptr, UN_Char * vUC2Ptr,size_t vSize2, FILE * inputFile, char * vcharPtr)
I tried to add reference of provided C application DLL but Error appear
A Reference to '.....\SomeApi.DLL' could not be added. Please make sure that the file is accessible, and that it is valid assembly or COM Component
So the other option I have is to use DLLImport
[DllImport("SomeAPI.dll", CharSet = CharSet.Unicode)]
public static extern AppResponseCode SomeFunction( ????? );
But I don't know what parameter types I had to pass for Return and Calling parameters to Call and obtain value from SomeFunction()
PS: Though I have source code for Complete C application but I can't re-compile it or modify it, I am only allowed to work with available Exe/DLL
|
|
|
|
|
Hi,
you will need P/Invoke stuff, DLLImport is part of that.
I once wrote an introductory article on it, see Article: P/Invoke, part 1[^].
You will have to figure out whether your C code is built for 32-bit or 64-bit, and make sure your C# app is built for the same width.
Pointers become IntPtr , which will take 32 or 64 bits depending on your app build settings, and both parties must agree!
I am worried about your FILE* , as FILE really isn't a managed beast. At best, you only have to pass it (as a pointer to whatever, say an int) from one C function to the next. I would never consider sharing file metadata between managed and unmanaged code; if needed I would pass a path to the unmanaged world and have it open, process and close the file all by itself.
For the return value (an enum ), you could simply cheat a little and declare it as an int .
Good luck!
modified 4-Oct-18 23:03pm.
|
|
|
|
|
|
Hi,
We have a search form in asp.net and based on the selected fields/ Options we are forming a dynamic query. I want to cache this query so that if any other user is trying to search the same thing I can just return the cached output instead of re-executing the query. Our environment is C# asp.net with DB2 as the backend. We are using plane ado.net not MVC.
Can anyone please let me know or guide me what to implement.
Thanks
|
|
|
|
|
What have you tried?
Where are you stuck?
What help do you need?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
What help do you need?
I need help in implementing caching the query at the application level.
|
|
|
|
|
It's going to be one of those ...
What help do you need?
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. No context, no idea what you have actually tried or what happened when you did, nothing.
Help us to help you ...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I have a form where we can search the information using "User Name", "email" and "zipcode" from the USERS table which has 900,000 records.
For Example User1: searches the information using "test@gmail.com" email address and User2 is also doing the same search after 5 min then I do not want to re-execute the query instead I want to display the results from Cache. My back end is DB2.
I am using OdbcCommand.
USER table has UserID, UserName, Email, Address1, Address 2, Zipcode, State
|
|
|
|
|
It's simple. All you have to do is Google for "mvc cache database results". Start reading and find something that's appropriate for your situation.
Remember though. Server's don't have infinite memory! Be careful what you cache.
|
|
|
|
|
We are not using MVC. We are using ado.net only
|
|
|
|