Programming Tips 💡
51.6K subscribers
67 photos
10 videos
30 files
354 links
Programming & AI:
Tips 💡
Articles 📕
Resources 👾
Design Patterns 💎
Software Principles

🇳🇱 Contact: @MoienTajik

🎯 Buy ads: https://telega.io/c/ProgrammingTip
Download Telegram
Listing Content Of Directory In Java 📁

In order to list the contents of a directory, below program can be used. 🗄

This program simply receives the names of the all sub-directory and files in a folder in an Array and then that array is sequentially traversed to list all the contents. 💎

import java.io.*;

public class ListContents {

public static void main(String[] args) {

File file =
new File("//home//user//Documents/");

String[] files = file.list();

System.out.println (
"Listing contents of " + file.getPath()
);

for(int i=0 ; i < files.length ; i++) {
System.out.println(files[i]);
}

}

}



#java #io
@ProgrammingTip
Server.MapPath Equivalent in ASP.NET Core 💁🏻‍♂️

Web Developers who use Microsoft technologies have always relied on the Server.MapPath method to resolve file paths.

In classic ASP and ASP.NET Web Forms and MVC versions up to and including 5. 🕒

This method has not been included in ASP.NET Core, so what do you use instead

[ Webiste ] : http://bit.do/svpath

https://t.me/pgimg/45


#AspMvc #Core #IO
@ProgrammingTip