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
390 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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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 …

762 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

21 Experts available now in Live!

Get 1:1 Help Now