Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / May 2004

Tip: Looking for answers? Try searching our database.

compile with jsc.exe and arguments

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jeza - 05 May 2004 07:28 GMT
hi

is it possible to use arguments when i compile a file with 'jsc file.js'

file.exe arg1 arg2

if its possible how should the code looks like to get arguments number , length, ...

tnx
jeza
Alex K. Angelopoulos [MVP] - 05 May 2004 10:24 GMT
If you're talking about in a batch file that you USE to compile JScript, you
just use batch file syntax, which uses %1...%9 for argument numbers, but
doesn't supply a length.

If you are talking about INSIDE a JScript.NET  assembly, the
System.Environment.GetCommandLineArgs array contains the ordered arguments
supplied on the command line.

> hi
>
[quoted text clipped - 7 lines]
> tnx
> jeza
jeza - 05 May 2004 21:40 GMT
hi

yes i'm talking to get argument passed when i execute my script.
i have this script to search in a file for the argument i pass when i run the script
myscript.exe argument
but i don't realy know how to get System.Environment.GetCommandLineArgs
can u post me the code how to work with this argument please

and if its possible to get the path of my script inside the script

tnx
jeza

> If you're talking about in a batch file that you USE to compile JScript, you
> just use batch file syntax, which uses %1...%9 for argument numbers, but
[quoted text clipped - 15 lines]
> > tnx
> > jeza
Alex K. Angelopoulos [MVP] - 08 May 2004 17:04 GMT
> hi
>
[quoted text clipped - 4 lines]
> but i don't realy know how to get System.Environment.GetCommandLineArgs
> can u post me the code how to work with this argument please

It's not really a script when it is compiled, by the way; it is now an
application.

Here's some demo code that will echo out the complete commandline, the
location of the assembly, and each of the commandline arguments passed to
the assembly:

//argdemo.js
// compile with:
// jsc /t:exe /out:argdemo.exe /nologo argdemo.js

import System;
import System.Reflection;

var args = System.Environment.GetCommandLineArgs();
//Note that the calling executable is one of the arguments.
System.Console.WriteLine("Raw commandline is: {0}",
System.Environment.CommandLine);
var Assembly = System.Reflection.Assembly.GetExecutingAssembly();
System.Console.WriteLine("Location: {0}", Assembly.Location);

var i = -1;
for (var arg in args) {
System.Console.WriteLine("argument {0}: {1}", ++i, args(arg));
}

> and if its possible to get the path of my script inside the script
>
[quoted text clipped - 21 lines]
>>> tnx
>>> jeza
jeza - 08 May 2004 23:11 GMT
hi
thank you very much.

now i have another question.
does .js have a library to connect to a FTP server

i would like my app(compiled with jsc.exe)
connect to ftp server
send a raw command and receive the server response to my command
and disconnect

> > hi
> >
[quoted text clipped - 56 lines]
> >>> tnx
> >>> jeza
Alex K. Angelopoulos [MVP] - 09 May 2004 00:32 GMT
> hi
> thank you very much.
>
> now i have another question.
> does .js have a library to connect to a FTP server

One of the reasons for the .NET CLR is to make the support libraries used by
applications universally identical, no matter the language used.

I don't believe there is a native .NET FTP client library, but the post
noted below documents some places to look for code which could be used like
this:

http://groups.google.com/groups?selm=2g1jdsF3gduuU1%40uni-berlin.de

> i would like my app(compiled with jsc.exe)
> connect to ftp server
[quoted text clipped - 62 lines]
>>>>> tnx
>>>>> jeza

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.