|
Okay i have not looked into this, but i figured maybe
someone else has. Will we able to embed C# directly into
ASP pages, like we can embed java into jsp. If so
will ASP have a servlet analog like jsp does.
I am learning jsp now and find it pretty easy, so i figure
if C# is able to do the same thing as java does for JSP
then it will make asp easier. I dont mean raw asp, i mean
have a strongly typed language for asp.
thanks
|
|
|
|
|
Actually any language that is supported under .NET will work within ASP+ pages. This includes both Microsoft's C#, VB (no more VBScript, you get the whole thing instead), and Javascript. Also many other third parties are working on other .NET compatible versions of their languages (such as Cobal, pascal, Fortran, etc.).
|
|
|
|
|
And to note another part to his question...
As required by the CLR Specification, all DotNet languages are strongly typed, so ASP.Net will act like your JSP.
-V-
|
|
|
|
|
Can I create custom user interface in C#, for instance like MS Office2000, similarly as in Visual C++.
Mike
|
|
|
|
|
Mike,
C# is a language, so it really doesn't define what you can and can't do as far as interface design. Microsoft with the .Net runtime has made all programming languages equally powerful, so anything you can accomplish in one language, you can reasonably expect to accomplish in any other .Net compatible language.
Microsoft is pretty hard-core about C#, so to answer your question, yes, you can make sophisticated UIs like you find in Office in C#. You can also make those UIs in VB, in Cobol, in Eiffel, etc.
|
|
|
|
|
Hi Mike,
If you are talking about writing a Windows Program than you just need to look up examples on System.WinForms. Since Microsoft is only documenting DotNet in C# you should be able to find lots of information on this.
-V-
|
|
|
|
|
I am dying to get my hands on the C#. My question is whether the latest or up coming installments of MSDN Universal Subscription will have beta version of C#.
|
|
|
|
|
The material is already available for download, I'm sure that it will be included in the next round of MSDN Universal distributions too. For more information on this, check out this thread on CodeProject.com
|
|
|
|
|
|
I am not sure if it has been said that C# has been submitted to ECMA or will be submitted to ECMA but I did a quick search of the internet and I get the impression that C# has not (yet) been submitted. Something that I found interesting is that Sun has submitted Java to ECMA and Microsoft has submitted JScript. I do not find anything in the ECMA web site about Java though. If, however, Netscape has submitted Java then it makes sense to me that Microsoft will submit C#.
ECMAScript is evidently a standardized JavaScript/JScript.
See: http://www.ecma.ch/
|
|
|
|
|
I guess it has been submitted (or atleast in the process)and they are reviewing it. But I dont know on what stage it is, but atleast EMCA are doing some work on c#. Not only C#, but also CLI. I guess one day or other both C# and CLI(Common Language Infrastructure, I guess it is same CLR) will be a standard. May be I'm too optimistic!
Refer to their website!
http://www.ecma.ch/ecma1/news/news.htm
*note if that link doesnt work, search "C Sharp" (not C#)
on their site.
regards
Ravi
|
|
|
|
|
Hi Ravi,
Yes C# has been sent and accepted as a Standard with Microsoft and IBM on the board for the committe. Also to note that JScript is also a full programming language now as well with JScript.Net
-V-
|
|
|
|
|
|
|
I guess no one can realy decide before he has a compiler at hand.
MS gave those at PDC, so how come they are not giving it away to everyone?
|
|
|
|
|
Depends whether you are asking "Is C# the mythical 'Cool' that we all heard rumours about last year", or "Is C# a good language".
According to the recent poll (http://www.codeproject.com/script/poll/detail.asp?topic=71) most people felt C# was definitely uncool - but it is really hard to judge until you've used the new IDE, written some apps and compared the functionality. Personally I feel it will be kinda nice to drop back to C# to write a COM client, then maybe do a little VB to whip up a neat UI, and then roll up the sleaves to get some hard core C++ going - all working together in the same environment. I think everything simply needs to be put into perspective.
As to whether C# is the Cool project, I was talking to the MS guys and got a definite 'sort of but not quite'. Cool was the name for an entire new technology on which .NET was based. C# is a major part of this, and so in a way C# was part Cool, but Cool was more than C#. At least that was my understanding...
|
|
|
|
|
C# is definitely cool to program in. BTW, you won't need to drop back to VB to do UI. C# (as well as managed C++) gets the same RAD support that VB has in VS.NET. Check out the following code I wrote in about a half hour to display three jpg images. Note, this code probably wouldn't be too hard to duplicate in VB, but try this in VC++ using Win32 API NOTE: the use of XML comments. The compiler supports stripping these out into an XML document like so:
<makefile>
all: MyPhotoAlbum.exe
MyPhotoAlbum.exe: MyPhotoAlbum.cs
csc /debug+ /doc:MyPhotoAlbum.xml /t:winexe \
MyPhotoAlbum.cs /r:system.dll \
/r:system.drawing.dll /r:System.WinForms.dll \
/r:System.Data.dll /r:Microsoft.Win32.Interop.dll
namespace CSharpApp
{
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.WinForms;
using System.Data;
///
/// Class representing my application's main window
///
public class MainWindow : System.WinForms.Form
{
/// Required designer variable
private System.ComponentModel.Container components;
private System.WinForms.Button m_button3;
private System.WinForms.Button m_button2;
private System.WinForms.Button m_button1;
///
/// IVar to hold reference of bitmap to paint
///
private System.Drawing.Bitmap m_bitmap;
private System.Drawing.Bitmap m_bitmap1;
private System.Drawing.Bitmap m_bitmap2;
private System.Drawing.Bitmap m_bitmap3;
private System.Drawing.Point m_orgBitmap;
public MainWindow()
{
//
// Required for Win Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after
// InitializeComponent call
//
try
{
m_bitmap1 = new Bitmap(@"c:\images\A.jpg");
m_bitmap2 = new Bitmap(@"c:\images\B.jpg");
m_bitmap3 = new Bitmap(@"c:\images\C.jpg");
}
catch (Exception e)
{
MessageBox.Show(e.ToString(), "Bummer!",
MessageBox.IconHand);
}
m_orgBitmap = new Point(10, 60);
}
///
/// Clean up any resources being used
///
public override void Dispose()
{
base.Dispose();
components.Dispose();
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor
///
private void InitializeComponent()
{
this.components =
new System.ComponentModel.Container();
this.m_button1 = new System.WinForms.Button();
this.m_button2 = new System.WinForms.Button();
this.m_button3 = new System.WinForms.Button();
this.AutoScaleBaseSize =
new System.Drawing.Size(5, 13);
this.Text = "My Photo Album";
this.BackColor = System.Drawing.Color.Blue;
this.ClientSize = new System.Drawing.Size(586, 445);
m_button1.Location = new System.Drawing.Point(8, 8);
m_button1.BackColor =
System.Drawing.SystemColors.ControlLight;
m_button1.Size = new System.Drawing.Size(75, 23);
m_button1.TabIndex = 0;
m_button1.Text = "Bitmap 1";
m_button1.AddOnClick(
new System.EventHandler(ButtonClickHandler));
m_button2.Location =
new System.Drawing.Point(104, 8);
m_button2.BackColor =
System.Drawing.SystemColors.ControlLight;
m_button2.Size = new System.Drawing.Size(75, 23);
m_button2.TabIndex = 1;
m_button2.Text = "Bitmap 2";
m_button2.AddOnClick(
new System.EventHandler(ButtonClickHandler));
m_button3.Location =
new System.Drawing.Point(200, 8);
m_button3.BackColor =
System.Drawing.SystemColors.ControlLight;
m_button3.Size = new System.Drawing.Size(75, 23);
m_button3.TabIndex = 2;
m_button3.Text = "Bitmap 3";
m_button3.AddOnClick(
new System.EventHandler(ButtonClickHandler));
this.Controls.Add(m_button1);
this.Controls.Add(m_button2);
this.Controls.Add(m_button3);
}
protected void ButtonClickHandler(object sender,
System.EventArgs e)
{
// Rectangles to store regions to invalidate
Rectangle rectPrev =
new Rectangle(m_orgBitmap, new Size(0,0));
Rectangle rectCurrent =
new Rectangle(m_orgBitmap, new Size(0,0));
// Grab current bitmap's size
if (m_bitmap != null)
rectPrev.Size = m_bitmap.Size;
// Select appropriate bitmap based on the sender
if (sender == m_button1) {
m_bitmap = m_bitmap1;
}
else if (sender == m_button2) {
m_bitmap = m_bitmap2;
}
else {
m_bitmap = m_bitmap3;
}
// Grab new bitmap's size
if (m_bitmap != null)
rectCurrent.Size = m_bitmap.Size;
// Create region, union of both rectangles
Region region = new Region(rectPrev);
region.Union(rectCurrent);
// Invalidate the combined regions
this.Invalidate(region);
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
// Draw background
g.FillRectangle(new SolidBrush(Color.Blue),
e.ClipRectangle);
//Render bitmap image
if (m_bitmap != null)
g.DrawImage(m_bitmap, m_orgBitmap.X,
m_orgBitmap.Y);
}
// The main entry point for the application.
public static void Main(string[] args)
{
Application.Run(new MainWindow());
}
}
}
|
|
|
|
|
WAH! What happened to my spaces?
|
|
|
|
|
It's good ol' HTML doing its thing...
I think you can avoid it by simply wrapping the code inside PRE tags, like this:
< pre>
// some code
int n = 70;
</pre>
Which will look like this:
int n = 70;
Much better, don't you think? And thanks for the sample code. It's amazing how similar it looks to Java.
Regards,
Alvaro
|
|
|
|
|
Hey Keith,
just a remark on your code:
//--------------------------------------
///
/// Clean up any resources being used
///
public override void Dispose()
{
base.Dispose();
components.Dispose();
}
//--------------------------------------
Isn't C# handling the memory freeing?
|
|
|
|
|
That code was inserted by the VS wizard for a "C# Windows Application". As I understand it, C# suffers the same problem as Java. The destructor or finalize method is not called in a deterministic fashion since Garbage Collection is not deterministic. So the docs recommend adding methods with names like Dispose() or Close() if you are holding onto non-memory resources that should be freed immediately when they are no longer needed as opposed to waiting for the GC to run.
|
|
|
|
|
Been dabbling with C# a bit now; I like the structure of the language....
... but where in the heck am I going to find all the dox for provided namespaces? (Can't find 'em anywhere) ... stuff like you used:
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.WinForms;
using System.Data;
|
|
|
|
|
C# is like Basic, in that, Visual Basic is programming in the Basic language, and Cool is programming in the C# language.
so, Visual Basic is Microsoft's implementation of Basic, and Cool is Microsofts implementation of C#.
(unless things have changed a LOT in the last 6 months)
|
|
|
|