|
LOL. Already tried that. Didn't work.
|
|
|
|
|
Hi all, I'm following a basic dotnet core tutorial ASP.NET Tutorial | Hello World in 10 minutes | .NET using a SBC Nanopim4 running Armbian. I've reached the dotnet run stage Of the asp sample ) and it reports it's listening on ports 5000 and 5001. However I can't browse to the site and if I run nmap from my laptop it returns both ports closed. Another thing is, if I run nmap localhost on the Pi it returns ports open but using it's actual ip address it returns ports closed - any ideas folks ?
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
By default, Kestrel only listens for connections on localhost ; you normally use another web server as a "reverse proxy" to your application.
You should be able to add a UseUrls call to your WebHostBuilder to make it listen on the actual IP address:
c# - Remotely connect to .net core self hosted web api - Stack Overflow[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks Richard, through that link I found that you can modify Properties\launchSettings.json as I show below - and all is good - probably not the way to do it in a production app but good enough for my learning at this early stage, The 10.10.1.143 parts were set to localhost. Thanks again.
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:6371",
"sslPort": 44318
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"WebApp": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://10.10.1.143:5001;http://10.10.1.143:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
|
Basic way to test net connectivity in windows (but same exists in linux.) Open a console window and type the following command.
telnet <host> <port>
Substitute in the above for the values you want to test for <host> and <port>. For example
telnet localhost 5000
There are several possible outcomes.
1- It reports immediately that it cannot find the host. This indicates a "Domain Name Server"(DNS) error. Outside the scope of what you are currently doing but generally because you typed the wrong value or you do not know the correct DNS name
2- It reports a no connection error immediately. That means it got to the computer (DNS) but that the port on that computer was not 'open'. So the app that you expected there was not in fact there.
3- It sits for a while and then reports an connection failure. That indicates that it is trying to get to the DNS but something is dropping the connection attempt between it and the computer. This is often a firewall or network issue.
4- It returns a blank screen. That indicates it successfully connected and thus the connectivity test is done.
What might one expect from such a test based on your description. I would suspect 1 or 2. You are using the wrong DNS or even though it 'reports' that it is waiting on that port either it isn't doing that at all or it opens it and immediately closes it.
Should note that these days this works for everything: http, https, soap, rest, TCP.
|
|
|
|
|
Hi All,
I need to connect to an old VMS server, that's not supported, via FTP, and change directory multiple times within the same session, to count the files in each directory.
I believe I can do this within Wininet.dll api in C/C++.
https://msdn.microsoft.com/en-us/library/ms909399.aspx?f=255&MSPPError=-2147217396
But when I look at the .NET Framework, I don't see a change directory function within FTP.
.NET FrameWork
https:
Any idea what is the best way to change directory (multiple times) within the same FTP session, and count a total number of files within each directory?
NOTE: I would also like to count the files in read-only if that's possible, just in case one of the files may be getting processed.
Thanks.
|
|
|
|
|
|
As Griff said, the FtpWebRequest is extremely limited. You'd probably do better to use a proper FTP library instead. For example, FluentFTP[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
Please don't post the same thing in multiple places - you already had it in QA: How can get windows.security.credentials.dll lib C#[^] so posting it in other places as well just duplicates work and that tends to annoy people.
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!
|
|
|
|
|
|
My colleague advised me to use obfuscator in my startup. But I do not know anyone who uses code obfuscation. Do you use obfuscators in your projects?
|
|
|
|
|
It's one level of protection for source code.
It makes it harder for the "average" person to understand the de-compiled code because the variable names are meaningless. I don't know how that impacts reflection if you use that.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Obfuscator-selling companies recommend obfuscating.
How many times have you been asked to reverse-engineer a project? Happened a few times to me, and even without obfuscation, it is usually not worth the effort.
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.
|
|
|
|
|
Never did it. I did not have to decompile the project.
|
|
|
|
|
Eddy Vluggen wrote: How many times have you been asked to reverse-engineer a project?
Only when the documentation sucks, and even then only usully one or two libraries within an project to find out how it all fits together.
|
|
|
|
|
I think the choice to obfuscate, or not, would be made based on a careful analysis of the target market (programmer, business, consumer segment), pricing, uniqueness of product, the attractiveness of the product-as-target for hackers, market competition, and many other factors.
It's a common strategy for developer tools to sell an obfuscated package at a lower price, with full source-code available for a higher price.
cheers, Bill
«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
|
|
|
|
|
Thanks for your reply. It is important for me to know different opinions
|
|
|
|
|
I have used obfuscators only a few times. I didn't need to use obfuscators. Obfuscators are used to protect the code from hacking. To prevent cheating in the game. For installation rights and software licensing.
You should know that obfuscators are different. Some confuse mainly class and variable names. Most obfuscators tangle the whole code. Here are some features that the popular obfuscator Dotfuscator provides:
"Renaming of identifiers to make reverse-engineering of the compiled assemblies more difficult.
Anti-tamper to detect the execution of tampered applications and terminate or respond to tampered sessions.
Anti-debug to detect the attachment of a debugger to a running application and terminate or respond to debugged sessions.
Anti-rooted device to detect if the application is running on a rooted Android device and terminate or respond to sessions on these devices.
Application expiration behaviors that encode an "end-of-life" date and terminate expired application sessions."
Also, there are obfuscators that use virtualization for obfuscating code. ArmDot, for example. It convert your code into an array of bytes. And then this array is interpreted by the virtual machine.
There are many obfuscators. The choice of obfuscator depends on your requirements and expectations.
|
|
|
|
|
Thank you for such an informative answer. You are right, I have to decide what exactly I need, what functions.
|
|
|
|
|
Hello colleagues, I am new learning c # and using DGVPrinter I want to know how to print the LOGO on the top left and the date and user on the top right of the header and create a model sheet that includes a frame around the text. I have tried to adapt the following code and I do not know how to do it. Please indicate me some video or the code in c # to continue learning. Thanks, I appreciate it.
Dim pagemargins As New System.Drawing.Printing.Margins (10, 10, 40, 40)
Dim queuePrinter = New DGVPrinter
queuePrinter.Title = qTitle
queuePrinter.SubTitle = String.Format ("List Printed On: {0}", Date.Now (). ToShortDateString ())
queuePrinter.SubTitleFormatFlags = StringFormatFlags.LineLimit Or StringFormatFlags.NoClip
queuePrinter.PageNumbers = True
queuePrinter.PageNumberInHeader = True
queuePrinter.ColumnWidth = DGVPrinter.ColumnWidthSetting.Porportional
queuePrinter.Footer = "XXXXXXXXX"
queuePrinter.FooterSpacing = 15
queuePrinter.PrintMargins = pagemargins
queuePrinter.HideColumns.AddRange (ExcludeList)
Dim logo As New DGVPrinter.ImbeddedImage ()
logo.ImageAlignment = DGVPrinter.Alignment.Left
logo.ImageLocation = DGVPrinter.Location.Header
logo.ImageX = 0
logo.ImageY = 0
logo.theImage = My.Resources.XXX_Logo_XSmall_BW
queuePrinter.ImbeddedImageList.Add (logo)
queuePrinter.PrintPreviewDataGridView (Grid)
|
|
|
|
|
Several things:
1) That's not C#, that's VB. You can't compile VB code in a C# project.
2) We have no idea what a DGVPrinter class is: it's not a standard class, so you would need to explain where it comes from. And probably, the best place to ask questions about how to use a class you got from a different website is on that website, not this ...
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 colleagues, thank you for answering my question.
1) Thanks for indicate that tha code in my question is Visual Basic. I hope somebody write it in C#
2) DGVPrinter is an article in Code Project:
Another DataGridView Printer
aureolin, 6 Feb 2014 4.85 (178 votes)
Rate: vote 1vote 2vote 3vote 4vote 5
DGVPrinter. DataGridView printing encapsulated in a stand-alone object. Very easy to use! Updated to allow printing columns wider than one page.
Download source code
Download Another DataGridView Printer PDF - 789.27 KB
Introduction
I went looking for a class to do printing from a DataGridView, and none of them did all that I was looking for. I needed to print all pages, some pages, or the current selection; and I needed to not have objects, controls, or code from the printer object sprinkled through the rest of my code - i.e., it needed to be completely self-contained. Nothing I found met all those requirements, so I ended up writing my own.
DGVPrinter's various settings provide good control of all aspects of printing on the page. You can set the Title and Subtitles, add a footer, and control whether the page number prints in the header or footer. DGVPrinter supports Right-to-Left printing for non-Western languages and includes a drawing override for situations where a cell or column has onPaint overridden in the source DataGridView control. While the default styles for the printed DataGridView are taken from the source DataGridView control, DGVPrinter also provides many attributes that allow you to control the styling of almost every aspect of the printout.
History
Version 1.0 - Initial publication
Version 1.1 - Added footer handling, and allows the page number to print in the header or footer, and if it should print on the same line as the header or footer
Version 1.2 - Finally (I believe!), fixed the string/column alignment problems. Also prints cell background colors properly, respecting the alternating rows style
Version 1.3 - Added support for printing columns that contain images
Version 1.4 - Added support for printing directly to a provided Graphics object
Version 2.0 - Added support for printing images on the page
Version 3.0 - Breaking changes! Please read!
About the Author
Report Ad
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
aureolin
Follow
this Member
United States United States
No Biography provided
... Thanks a lot
|
|
|
|
|
If you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.
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!
|
|
|
|