How to get variable (a video filename) from Lua and use in VB Net?.
In Lua:
function videoID(sender, vidsource)
if sender.Name == 'Awaken' then
vidsource = 'awaken.mp4'
elseif sender.Name == 'Crew' then
vidsource = 'Crew.mp4'
else
return vidsource
end
local f = assert(io.open(main_path..'/GLauncherResources/video.txt', "w"))
f:write(vidsource)
f:close()
end
Next, in VB Net, I want to read a variable from file video.txt (just contains 1 line), and use the variable as video name which will play in vb net:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim video As String
Dim path As String = "E:\GLauncherResources\video.txt"
video = File.ReadAllLines(path).ToString()
Console.Write(video)
MediaPlayer1.URL = video
'Dim video = IO.File.ReadAllLines(My.Application.Info.DirectoryPath & "\video.txt")
'MediaPlayer1.URL = video
End Sub
Or is any other way just pass the variable without need to save to a text file?.