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
392 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Share codes 68 120
Azure Remote Apps and an Access program 5 76
CRM Solution Specifically Designed for Non Profit Organisation 7 130
IT Desktop Support 11 75
This very simple solution applies to a narrow cross-section of the "needs to close" variety. In this case, the full message in Event Viewer was in applog, Event ID 1000: Faulting application iexplore.exe, version 8.0.6001.18702, faulting module …
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…
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
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…

831 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