Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Using GetObject in C#


Message #1 by Philip Steel <PhilipS@t...> on Mon, 10 Jun 2002 09:56:55 +0100
Philip,

	Assuming you're just trying to produce *.zip files, is the use of
the slow cross platform Java library required?  If not, try this out:

http://www.icsharpcode.net/OpenSource/NZipLib/default.asp

	Off topic, I wonder if MS will try to fry this guy for releasing his
source code GPL'ed.  I remember reading an article on /. that mentioned the
license agreement for the csc.exe says that you cannot release your source
code in a manner that would make it open source.  I don't know, maybe I just
dreamed this all up, but I don't think so.

- Chuck

-----Original Message-----
From: Philip Steel [mailto:PhilipS@t...]
Sent: Monday, June 10, 2002 9:40 AM
To: ASPX_Professional
Subject: [aspx_professional] RE: Using GetObject in C#


Nice one - I wrote a .vb that does the same, though the C# way
must, as you say, exist somewhere.....

here's what I did - 

Namespace MyNamespace

    Public Class VBObject

	    Public Sub ZiptIt(ByVal strFile as String, ByVal strZipFile As
String)
            'strFile is the file you want to zip up
            'strZipFile is the file you want it to be called when it's
zipped
		    Dim javaObj As Object
		    javaObj = GetObject("java:ZipFunctions")
			    javaObj.ZipFile(strFile, strZipFile)
		    javaObj = Nothing
	    End Sub

    End Class

End Namespace

Is it possible to compile .vb and .cs together into the same project in
Vs.NET?

Thanks for you help,

P

-----Original Message-----
From: Feduke Cntr Charles R [mailto:FedukeCR@m...]
Sent: 10 June 2002 14:31
To: ASPX_Professional
Subject: [aspx_professional] RE: Using GetObject in C#


> It's actually a java class that I'm calling: in ASP it used to be
something 
> like this - 

	Ooh, this is painful.  Ergh.  How about just writing a *.vb that
returns an instance of the class or does whatever you need to do with the
class?  That's what I'd do if I couldn't find the answer before lunch time.
There has to be an equiv in C# though, or C# has to be able to use the VB
version.

- Chuck

-----Original Message-----
From: Philip Steel [mailto:PhilipS@t...]
Sent: Monday, June 10, 2002 9:21 AM
To: ASPX_Professional
Subject: [aspx_professional] RE: Using GetObject in C#


It's actually a java class that I'm calling: in ASP it used to be something 
like this - 

Set myJavaObject = GetObject("java:ZipFunctions")

This still works in VB.NET, thus - 

Dim myJavaObject
myJavaObject = GetObject("java:ZipFunctions")

but I can't figure out the C# way yet.

I think your way would work with a normal COM object, eg
ObjectManager.GetObject("ADODB.Connection")

P

-----Original Message-----
From: Feduke Cntr Charles R [mailto:FedukeCR@m...]
Sent: 10 June 2002 14:01
To: ASPX_Professional
Subject: [aspx_professional] RE: Using GetObject in C#


Phil,

	Would

ObjectManager.GetObject(... GUID HERE ...)

work for you?  There are other ways of wrapping COM and ActiveX components
with a .NET wrapper class, and this is supposed to be an automated process.
I've read it before and can look it up again if you can't find any
additional help on it.

- Chuck

-----Original Message-----
From: Philip Steel [mailto:PhilipS@t...]
Sent: Monday, June 10, 2002 4:57 AM
To: ASPX_Professional
Subject: [aspx_professional] Using GetObject in C#


Hi all,

Does anyone know if it's possible to use any of the VB runtime members in
C#?

Specifically I need access to the 'GetObject' function to use an old
component. In the documentation
it's in Microsoft.VisualBasic.Interaction as a runtime member, but does this
mean
it'll only be able in VB?

Cheers

Phil

Phil Steel
Application Developer Consultant
TEQUILA\ Digital
82 Charing Cross Road
LONDON WC2H 0QB
020 7557 6228







  Return to Index