Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
my client has had his website developed in ASP.NET C#. Since then the developer closed down and now he needs to re-host his website on different server.
The website is split into two parts: admin panel and main pages. each folder contains bin, Views, Assets subfolders, web.config files and Global.asax file. The website uses Entity Framework but there are no database files whatsoever and web.config files need to be added. Is it possible to somehow reverse engineer the source code to create needed databases along with all the required tables?
Although it can be a daunting task, you can decompile .net binaries with the following tool: http://ilspy.net/
If EntityFramework code first was used, you can restore the database using entity framework migrations. See the last part of this article:
https://msdn.microsoft.com/en-us/library/jj193542(v=vs.113).aspx
In addition to ilspy I'd recommend looking at JetBrains dotPeek. I've used it to recover source code for a couple of my projects from back before I was using a proper source control.
One thing to be aware of when using a decompiler is that you're going to get the actual code produced, not the original source. The things that we call 'syntactic sugar' will look completely different when decompiled. Some of them might come out so mangled that you won't get them to compile.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I don't know if someone has already asked this simple question earlier as well. So, the question is I have a simple code test for one of my assignment, I want to use C# to solve the problem, and I am wondering if I build a new solution in C# with the main method to run the code within the solution, then it will contain probably an sln file and also csproj file and some other files as well. So will it be wise to submit the entire solution as zipping or upload in a repo for an assignment, or there are some other smarter ways to submit a code assignment while coding in visual studio in C#.
I don't want a logic or code for my assignment, I just expertise ideas I would say as I more of intermediate in .NET
TIA
I guess it depends on how your tutor is expecting / willing to receive it?
The modern (and arguably best in my opinion) way would be to push it to a repo. Otherwise you could go old school and zip up the whole folder structure (minus the bin and obj folders).
I think it's much better to keep code in one file.
You could try the Visual Studio Code editor to create one-file programs.
Or use the online C# compilers (.NET Fiddle, OnlineGDB). I personally use the online compilers, and then just store the code on my computer in *.cs files.
Just zip your whole project and upload it to the google drive. After uploading it into the drive you will get an option of sharing setting and through that you can feed the email id of the person whom you want to send it.. That link will be sent to that person and he/she can download it easily...
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I need to write code that receives firmware update files from various sources (nothing is a given, not even the file extensions) and passes them up to the cloud so that our software can download them to individual machines.
As part of the process, the front end needs to give the users a richer experience, so I need to include information such as the version number, last time there was an approved update to the file, and some other info about who is responsible for the update.
I've been directed to pass the data in as "meta-data" so that we don't have to include two files and at this point that doesn't seem like a very viable option. I've been researching meta data all day. TagLib is only for media files. I can use Microsoft API Code Pack to read some attributes but it won't let me write anything.
The shell32 option looks like the only other possibility but I can't figure out how to write to it. I'm using C# code in VS 2019, currently .NET framework 4.6.1 but we are about to upgrade to 4.8, I think.
Is there a practical way to write a string value as meta-data into a file without knowing anything more about the file than what I could discover with c#?
If you don't want to provide additional files or locations with the meta information you can create a new single file which contains your meta data and the actual firmware update. Think of it as a ZIP file where you have the firmware update file and some other file with the meta information. This way you will have only one file you can send around, but it has all the information you will need at any later point.
You cannot change the firmware update file in any way, specially if you don't know how the file format is. It would most likely break the firmware update.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
How can I tell the difference between source and published .NET code?
I am looking at some inherited code that I have not touched in about a year. The original designer had me first publish locally before uploading the published code to the internet server. Now I am looking a number of backed up source folders as well bas backed up published folders. I should have done a better job at naming the folders, I guess. Now I wonder: How can I tell the difference between source and published .NET code? Is there some easy way to see if some folder that contains only published code is lacking a file or xml setting?
As changes are made, they are published in the UI, so that means there should be some new files, or deleted files, and the directory tree may not be 100% the same. What you could do is download the deployed code to your local machine, and use a tool like Beyond Compare or some other directory comparer and let it determine the markup changes for you. There are several tools that do a good job for this.
That would give you an idea of the difference between files, but won't parse DLL's. That you would have to use a tool like reflector or Telerik's JustDecompile to compare the code, but I really wouldn't go that far, but you could.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am programming in C# since half a year. I have made a database project. What I want to do is, now that my project is finished, I want that no one should be able to edit any of the code of my C# project. How can I make my C# project uneditable?
You can hide give out DLLs of the compiled code to others, which they could then use without being able to see / edit the source code.
You can't make code permanently read only / I can't think of a reason why you'd want to (since if you had a bug you'd need to edit this code). However if you put your code into source control (e.g. TFS (free for small teams at http://tfs.visualstudio.com)) you can have a copy of your code with a full change log, so even if someone changed it, you could pull back a version as of today which didn't include their changes.
Alternatively you can use file permissions to stop others from editting the code, or make the files read only if you're worried about accidentally updating the code - but you'd still be able to edit it by amending those permissions / removing the read only flag at a later date.
As others have indicated you cannot really make your code readonly. What you can do is sign your assemblies. Other people will still be able to read and change your code. But as long as you keep your private key private, they will not be able to create the same signed assembly.
This does require that all the assemblies you reference are signed as well and that you store your private key in a safe place. If someone else gets your key, he or she will be able to recreate your assemblies, if you loose your key you will not be able to recreate them.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
We want to implement a application help and documentation system. It should be based on HTML, because there are a lot of existing files and it gives us the most flexibility. Currently we use CHM files. We want to enable internal people (not developers) to edit the contents.
We thought of a stand-alone application that supports TOC, indexing (tags), search, etc. We also thought of using a local web server.
Until now our application uses pure C#, it would be good to keep this.
We are totally clean of web/asp knowledge, so the question is:
Where is a good place to start?
You can use documentation apps like SandCastle
Which use your XML documentation in your code to generate a help file.
Finally we ended up implementing a local HTTP server:
Internal people creates HTML content within our internal network
Our own build-tool creates the TOC and a search index and packs all content to a zipped file
The zipped file is packed into the application installation
When the end-user call help from within our application, the local http server is started
The HTTP server uses the HttpListener class
With this, it is possible to have some HTTP queries for special tasks like starting tools of our application by clicking a link without interception of the browser