Solved

Hi,  I have called a script in my .net code which creates a .csv file and writes into it. The file is created and the program is executed without errors but the created file has nothing written into i

Posted on 2009-04-01
7
394 Views
Last Modified: 2012-05-06
Hi,

I have called a script in my .net code which creates a .csv file and writes into it. The file is created and the program is executed without errors but the created file has nothing written into it. I'm able to create and write into the file from .net. Also, when the script is run separetly writes into the file correctly but not when it is called from .net. what could be the reason...

Someone pls guide me...
Thank You.
It's a vb.net program,not asp.net.., I ve given my code snippet...I m using VS2003.
 
I ve added Illustrator application as reference...
This is my vb.net code:
 
FormLoad()
illusapp = New Illustrator.Application
illusapp.DoJavaScriptFile("C:/Program Files/Adobe/Adobe Illustrator CS2/Presets/Scripts/attribute.jsx")
 
attribute.jsx has the following lines:
myfile=new File("C:/Documents and Settings/Administrator/Desktop/file.txt");
myfile.open("w",undefined,undefined);
myfile.write("hello");
 
The file is created but has nothing in it...

Open in new window

0
Comment
Question by:lword
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 24037882
Hi, lwrod.

You aren't closing the file.  Try adding

    myfile.close

after line 13.
0
 

Author Comment

by:lword
ID: 24038025
Thanks BlueDevilFan..But it doesnt work :-(..Plz suggest me any other idea..
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 24038144
How about

    myfile.close();
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:lword
ID: 24038175
Thanks BlueDevilFan...it works when using myfile.close()....Thank you so much..
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24038189
You're welcome.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24040029
If you're satisfied with the solution, then please don't forget to close the question.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question