# \[ASP\] ActiveX, Com ports, Read file

**URL:** <https://forum.kirupa.com/t/asp-activex-com-ports-read-file/56853>\
**Category:** programming\
**Created:** [July 8, 2004, 3:38am UTC](https://forum.kirupa.com/t/asp-activex-com-ports-read-file/56853 "2004-07-08T03:38:37Z")\
**Posts on this page:** 2\
**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, 3:38am UTC](https://forum.kirupa.com/t/asp-activex-com-ports-read-file/56853/1 "2004-07-08T03:38:37Z")

</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:
     	Code:
     &lt;% @Language = "VBScript" %&gt;
 &lt;% Response.buffer = true %&gt;
 &lt;%
 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
 %&gt;
```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 9, 2004, 4:02am UTC](https://forum.kirupa.com/t/asp-activex-com-ports-read-file/56853/2 "2004-07-09T04:02:16Z")

</div>

Sorted it out… 99% that is… only need to ActiveX to go with it ? Any ideas !?
