vb GetWindowsDirectory function in question

Users questions:My aim is to use GetWindowsDirectory function to get the window's full catalog, and then create a new WindowsDirectory text file, then write the file in the directory name, my program is as follows: n = GetWindowsDirectory ("windows", 64) Open "e: * windows.txt" ForOutputAs # 1Write # 1, windowsClose # 1 to open the text file later, nothing inside. .. Does the above procedure where the wrong place, the correct procedure should be how to write, thank you!
Experts answer: you should do with the future in mind, including all of the returned string must be so used. To do with a fixed-length string parameters. dimaasstring * 256 'reputation willLong string dimbasstring 'then declare an ordinary string GetWindowsDirectory (a, 256)' when the need to use fixed-length string as the first parameter. B = Replace (a, chr (0 ),"")' forReplace the return of all the useless character string open "e: * windows.txt" foroutputas # 1Write # 1, bclose # 1
  • This information provided by the users.Thanks!