# Read file, ActiveX, Com ports

**URL:** <https://forum.kirupa.com/t/read-file-activex-com-ports/115380>\
**Category:** Uncategorized\
**Created:** [July 8, 2004, 2:02am UTC](https://forum.kirupa.com/t/read-file-activex-com-ports/115380 "2004-07-08T02:02:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ol4pr0](https://avatars.discourse-cdn.com/v4/letter/o/5fc32e/32.png) [@ol4pr0](https://forum.kirupa.com/u/ol4pr0)\
**Post date:** [July 8, 2004, 2:02am UTC](https://forum.kirupa.com/t/read-file-activex-com-ports/115380/1 "2004-07-08T02:02:09Z")

</div>

hey guys. i got a couple of questoins referrring the the working script below.  
i am very new to asp, and just need to make this one thing in regular asp

```
 1: how would i get this script to give the output in an array 
 2: i would i transform this script using a ActiveX
 3: how can i read the data from a com port instead from the text file.
 
 Any help would be great:

```

```auto

     <% @Language = "VBScript" %>
     <% Response.buffer = true %>
     <%
     Dim filename, content
     filename = "textfile.txt"
       
     Set fs = Server.CreateObject("Scripting.FileSystemObject")
     
     path = Server.MapPath(filename)
     
     If(fs.FileExists(path)) Then
        Set f=fs.OpenTextFile(path, 1)
       
        do while f.AtEndOfStream = false
           content = content & f.ReadLine & ""
        loop
       
        Response.Write(content)
       
        f.Close
     
        'Delete permission fout... 
        fs.DeleteFile(path)
       
        Set f=nothing
        Set fs=nothing
     Else
        Response.write("File doesn't exist")
     End If
     %>
     

```
