?
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
Medium Priority
?
398 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 2000 total points
ID: 24038144
How about

    myfile.close();
0
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This collection of functions covers all the normal rounding methods of just about any numeric value.
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.
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

770 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