Share via

string to stream

Yusuf 791 Reputation points
2022-03-17T04:49:25.587+00:00

Hi,
How do I remove open file dialog and using static file path for example "C:\Temp\file01.lic"
I do not know the conversion from the file path to Stream

myStream = OfDLicense.OpenFile()
if (myStream is nothing) then
    ULicense = Portable.Licensing.License.Load(myStream)
    ' -----
 End If
 

Thank you in advance.

Developer technologies | .NET | Other
Developer technologies | VB
0 comments No comments

Answer accepted by question author

  1. Jiachen Li-MSFT 34,241 Reputation points Microsoft External Staff
    2022-03-17T06:31:46.89+00:00

    Hi @Yusuf ,
    If you want to open the file directly with absolute path, you can refer to the code below.

            Dim filepath As String = "C:\Temp\file01.lic"  
            Dim myStream As New FileStream(filepath, FileMode.Open)  
    

    Best Regards.
    Jiachen Li

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    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.

    Was this answer helpful?

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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