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
391 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now