Read files from Remote place on net

Dani_S 3,786 Reputation points
2024-08-06T08:21:18.3666667+00:00

Hi,

1.I need to read xml file from the net using \domain\netlogon\myXml.xml

and read it in my app when login and insert the valus in the login fileds.

How is can be done?

2.I need to read image file from the net using \domain\netlogon\myLogo.png

and read it in my app when login and insert to image obj

How is can be done?

Thanks,

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,517 questions
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 42,976 Reputation points Microsoft Vendor
    2024-08-07T01:57:57.6+00:00

    Hello,

    For the first two requirements, it really has to do with how your remote machine, often called a server, provides file transfer services.

    For static resource files, there are usually two file transfer methods, FTP and Http. After you have configured the server-side file transfer, you can refer to the following documents to get these files, and after that, the process is the same as operating local files.

    For question 3, you can use the following code to get the current Domain.

    try
                {
                    string currentDomain = System.Net.Dns.GetHostName();
                    Console.WriteLine($"The current domain is: {currentDomain}");
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"Error occurred: {ex.Message}");
                }
    
    

    As a side note, per Guidelines for posting a quality question on Microsoft Q&A, please do not post multiple questions in a single thread.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.