|
Pffff well done.
I make myself some work in the other thread to post you some code just to realize now that you already found most of what you were searching for.
Please stick to ONE thread and dont hop around.
|
|
|
|
|
hii all;
i want ask some questions about network.
1-if am in lan and we connect to internet through proxy server. of course the proxy replace each request ip address of any machine on lan by his ip. the destination host will replay on proxy ip. how can the proxy determine the staion on lan who made original request to take response? also same question if i access internet in lan through (ics) for ex pc has modem
2- if i bind a sockt on lan its address and port will be on lan only. if this machine can access internet through lan is there away to bind it on lan router which access internet or i mean the interface which has direct access to internet so i can communicate with it from outside like imesh wich can work even if am in lan?
marcoryos
|
|
|
|
|
With an admission that i am quite novice to C#, (i am only 30 days old) i have few doubts if C# is suited for engineers? Say, if I want to develop a numerical tool to do some matrix calculation or Computational Fluid Dyanmics Analysis, should i prefer C or C++ or C#....I know MATLAB is written in C and so do some other engineering software.
Regards,
Amit
|
|
|
|
|
amitmohanty wrote:
i am only 30 days old
Your parents must be congratulated as your linguistic skills for such a young person are way above what I could have ever expected.
amitmohanty wrote:
i have few doubts if C# is suited for engineers? Say, if I want to develop a numerical tool
Does this answer your question? Harness the Features of C# to Power Your Scientific Computing Projects[^]
- SUMMARY: The C# language has been used quite successfully in many kinds of projects, including Web, database, GUI, and more. One of the last frontiers for the application of C# code may well be scientific computing. But can C# measure up to the likes of FORTRAN and C++ for scientific and mathematical projects?
In this article, the author answers that question by looking at the .NET common language runtime to determine how the JIT compiler, Microsoft intermediate language, and the garbage collector affect performance. He also considers C# data types, including arrays and matrices, along with other language features that play an important role in scientific computing applications.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Well I am 30 days old means I have started coding C# since last 30 days. I usually code in MATLAB and C.
Thanks, reading your link. Let me see what it has to offer.
Regards and Thanks,
Amit
|
|
|
|
|
|
Thats okay. Its fun By the way, the article is exactly what I was looking for. Thanks a lot.
Amit
|
|
|
|
|
Are you going to stick with C#?
/\ |_ E X E GG
|
|
|
|
|
Well thats a good question. I think nothign is all good and perfection is a myth. So I am still trying to find out what are the drawbacks of doing coding with C# if i am trying to develop a scitific tool. I will wait and see. But anyway, if nothign else I would still learn it. I like it. Reasons may be unknown. Now can anone tell me what is not so good about C# if i am considering scientific computing?
Regards,
Amit
|
|
|
|
|
amit
If you read the article posted by Colin, it is pretty interesting. The article was very interesting if you are a hardcore matlab user and seeing how one can exploit c#.
In the mean time you can take a look at this
http://www.codeproject.com/csharp/dynmatrixmath.asp
In my opinion having come from an embedded systems background and moving into windows application development, I have to say that matlab is simply the best for prototyping algorithms quickly and efficiently. The answer is partly baised because i have used matlab for 8 years and c# for 3 months. If you are going to do simulations using the model developed in matlab you can always run it on a unix box as well.
I have to say c# is fantastic for doing all the pretty window gui things
You can also do matrix calculations in c++ because i recall seeing someone develop c++ matrix libraries to give c++ matlab like matrix functionalities.
cheers
|
|
|
|
|
When I reopen an old C# console application, say Class1.cs, and modify it; I found no build option for that. Damn, how do i complie it and build the solution.
Amit
|
|
|
|
|
Could you explain much more your problem ?
|
|
|
|
|
Thank you for your response LongHC. It is like that
1> I opened a new console application in microsoft studio.net for C#.
2> Say , I modified it to write "HelloWorld" program.
3> I build it and run it. everything is fine till now.
4> I close it.
5> I come back tomorrow ro sometime after and feel like i want to make some changes in the code of HelloWorld.cs
6> so I open the file HelloWorld.cs, but i can't see the build option on the toolbar at all. I can't build it if i want to and hence i can't do any modification to it. So, now i have to open a new console apllication. Defnitely that will have the Build option on the toolbar but thing is that I have to do everythign once more or i have copy my previous program to the new file.
I know I am doing somethign really silly, but can't really figure out. Do i need to make somechanges in the option setting?
Regards,
Amit
|
|
|
|
|
Any file that is openj in the vs cann't be build ,cuz it's not in solution file or project file,if you want to be able to compile it ,don't open just the file,but open the .csproj file or the .sln file and you will be able to do any thing.
|
|
|
|
|
Thanks very much from a novice..
Take Care
|
|
|
|
|
amitmohanty wrote:
Thanks very much from a novice..
You ?
amitmohanty wrote:
Take Care
?
|
|
|
|
|
I am novice
|
|
|
|
|
i want to create a Crystal report, all the records are stored in DATASET how can create a report from dataset
i tried this code but it's not working
Report1 is blank
***************************************
Report1 rpt = new Report1();
rpt.SetDataSource(dsrefresh);
crystalReportViewer1.ReportSource = rpt;
***************************************
this code will UNION all DBF files from temporary folder, to dataset.
this part is ok
while (i < countdays)
{
DirectoryInfo Folders = new DirectoryInfo(@ALOHA_PATH+"\\"+datefolders+"");
if (Folders.Exists)
{
string ITMConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + ";Extended Properties=dBase IV";
OleDbConnection ITMConnection = new OleDbConnection(ITMConnString);
string ITMSelectQuery = "Select * from "+ALOHA_PATH+"\\GNDITEM.DBF UNION ALL Select * from "+ALOHA_PATH+"\\"+datefolders.ToString()+"\\GNDITEM.DBF" ;
//MessageBox.Show(ITMSelectQuery);
OleDbDataAdapter da= new OleDbDataAdapter(ITMSelectQuery ,ITMConnection);
da.Fill (dsrefresh,"GNDITEM");
dv = new DataView(dsrefresh.Tables["GNDITEM"]);
dataGrid1.DataSource = dv;
ITMConnection.Close();
}
i +=1;
// frmwait.Close();
// this.Show();
}
dv = new DataView(dsrefresh.Tables["GNDITEM"]);
dataGrid1.DataSource = dv;
|
|
|
|
|
I am trying to make a webservice that return a image to ppc. I have tried to return it as a bitmap but it give this following error "System.Drawing.Bitmap cannot be serialized because it does not have a default public constructor" so I changed from bitmap to base64 string, this works, however when I tried to convert base64 string back to bitmap(on ppc) I got the same error again.. Do anyone know exactly what I should do?
|
|
|
|
|
Make sure to extract the bytes of the image to transfer. (And base64 that array)
public Image GetImageFromBytes( byte[] bytes )
{
MemoryStream stream = new MemoryStream(bytes);
Image image = Image.FromStream( stream );
return image;
}
public byte[] GetImageBytes(Bitmap bitmap)
{
MemoryStream stream = new System.IO.MemoryStream();
bitmap.Save( stream, System.Drawing.Imaging.ImageFormat.Jpeg );
stream.Position = 0L;
System.IO.BinaryReader reader = new System.IO.BinaryReader(stream);
byte[] bytes = reader.ReadBytes( (int)stream.Length );
stream.Close();
return bytes;
}
|
|
|
|
|
public Image getObjectPicture(string objectID)
{
OdbcConnection connection= new OdbcConnection(@"Driver={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=ic;UID=;PASSWORD=;");
OdbcCommand cmm = new OdbcCommand("SELECT Picture FROM Object WHERE ObjectID='"+objectID+"'", connection);
connection.Open();
OdbcDataReader reader = cmm.ExecuteReader();
string filename= @"c:\default.bmp"; //default pic
while(reader.Read())
{
filename = reader[0].ToString();
}
Bitmap bitmap = new Bitmap(filename);
MemoryStream stream1 = new System.IO.MemoryStream();
bitmap.Save( stream1, System.Drawing.Imaging.ImageFormat.Bmp );
stream1.Position = 0L;
BinaryReader br = new BinaryReader(stream1);
byte[] bytes = br.ReadBytes( (int)stream1.Length );
stream1.Close();
MemoryStream stream2 = new MemoryStream(bytes);
Image image = Image.FromStream( stream2 );
return image;
}
I combined the given code and did this, and I got this error message "System.Drawing.Imaging.ImageFormat cannot be serialized because it does not have a default public constructor.", I put this coding on the webservice though.. that exactly should I do, I am rather confuse now
|
|
|
|
|
Hi,
I have many questions about checkbox :
1/I would like to create dynamicaly 8 checkbox into a form.
The name of each checkbox begin with "CHECKBOX_CAM_".
So :
CHECKBOX_CAM_1
CHECKBOX_CAM_2
CHECKBOX_CAM_3
...
CHECKBOX_CAM_8
2/ I would like to set/get some properties like text,position, tag,... with a SQL Database.
3/ I would like to retrieve the state of the group to a byte at any moment. when the user un/select one or more checkbox.
Best Regards
youssef
|
|
|
|
|
////////////////////////////////////////
CheckBox[] CheckBox1 = new CheckBox[8];
for (int i = 0; i < CheckBox1.Length; i++)
{
CheckBox[i].ID = "CHECKBOX_CAM_" + i.ToString().Trim();
}
///////////////////////////////////////
...
public string GetCheckBoxText(int x)
{
return CheckBox[x].Text;
}
public bool[] GetChecked()
{
bool[] a = new bool[8]
for ()
{
...
}
return a;
}
ASP.NET C# VB VC & SQL Windows APP ...
|
|
|
|
|
Hello
I have a school-project in C#. I'm using Visual C# 2005 Express Beta Edition.
In my Project I have about 7 Forms that all have the same Menu at the top. So I thought about putting the Code of the Menu in an extra DLL and include that DLL in my Forms.
Right now I am at the point that I can see the Menu wenn I start the Project. My question now is how can I connect the Event.Click of my Menu Items with The Forms that should be started wenn I Click the Item. Every Form that needs the Menu should also be reachable over the Menu.
I thought that I could take the Forms in an Arraylist but it make problems
Here is the Code of the DLL. The First part doesn't make any problems. But the second part make errors when i start the Project. It tells me something like i should be shure not to make an endless loop.
I call the DLL-constructor in the Forms with
Arraylist forms = new Arraylist(10);
Form1 for1 = new Form1();
.
.
.
forms.Insert(0, for1);
.
.
.
menue m = new menue(this, forms);
<br />
<br />
#region Using directives<br />
<br />
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
<br />
#endregion<br />
<br />
namespace menuelib<br />
{<br />
public class menue : MenuStrip<br />
{<br />
Form neu = new Form();<br />
ArrayList forms = new ArrayList(10);<br />
Form formular = null;<br />
private ToolStripMenuItem dVDToolStripMenuItem;<br />
private ToolStripMenuItem erstellenToolStripMenuItem;<br />
private ToolStripMenuItem bearbeitenlöschenToolStripMenuItem;<br />
private ToolStripMenuItem personToolStripMenuItem;<br />
private ToolStripMenuItem erstellenToolStripMenuItem1;<br />
private ToolStripMenuItem bearbeitenlöschenToolStripMenuItem1;<br />
private ToolStripMenuItem dVDListeToolStripMenuItem;<br />
private ToolStripMenuItem verleihToolStripMenuItem;<br />
private ToolStripMenuItem ausleihenToolStripMenuItem;<br />
private ToolStripMenuItem geliehenToolStripMenuItem;<br />
<br />
<br />
public menue()<br />
{ }<br />
<br />
public menue(Form form, ArrayList formen) : this()<br />
{<br />
formular = form;<br />
forms = formen;<br />
dVDToolStripMenuItem = new ToolStripMenuItem();<br />
erstellenToolStripMenuItem = new ToolStripMenuItem();<br />
bearbeitenlöschenToolStripMenuItem = new ToolStripMenuItem();<br />
personToolStripMenuItem = new ToolStripMenuItem();<br />
erstellenToolStripMenuItem1 = new ToolStripMenuItem();<br />
bearbeitenlöschenToolStripMenuItem1 = new ToolStripMenuItem();<br />
dVDListeToolStripMenuItem = new ToolStripMenuItem();<br />
verleihToolStripMenuItem = new ToolStripMenuItem();<br />
ausleihenToolStripMenuItem = new ToolStripMenuItem();<br />
geliehenToolStripMenuItem = new ToolStripMenuItem();<br />
this.SuspendLayout();<br />
<br />
<br />
<br />
this.Items.AddRange(new ToolStripItem[] {<br />
this.dVDToolStripMenuItem,<br />
this.personToolStripMenuItem,<br />
this.dVDListeToolStripMenuItem,<br />
this.verleihToolStripMenuItem});<br />
Location = new Point(0, 0);<br />
Name = "menuStrip1";<br />
Padding = new Padding(6, 2, 0, 2);<br />
Raft = RaftingSides.Top;<br />
TabIndex = 0;<br />
Text = "menuStrip1";<br />
<br />
formular.Controls.Add(this);<br />
<br />
<br />
dVDToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] {<br />
erstellenToolStripMenuItem,<br />
bearbeitenlöschenToolStripMenuItem});<br />
dVDToolStripMenuItem.Name = "dVDToolStripMenuItem";<br />
dVDToolStripMenuItem.SettingsKey = "Form1.dVDToolStripMenuItem";<br />
dVDToolStripMenuItem.Text = "DVD";<br />
<br />
erstellenToolStripMenuItem.Name = "erstellenToolStripMenuItem";<br />
erstellenToolStripMenuItem.SettingsKey = "Form1.erstellenToolStripMenuItem";<br />
erstellenToolStripMenuItem.Click += new System.EventHandler(this.erstellenToolStripMenuItem_Click);<br />
erstellenToolStripMenuItem.Text = "erstellen";<br />
<br />
bearbeitenlöschenToolStripMenuItem.Name = "bearbeitenlöschenToolStripMenuItem";<br />
bearbeitenlöschenToolStripMenuItem.SettingsKey = "Form1.bearbeitenlöschenToolStripMenuItem";<br />
bearbeitenlöschenToolStripMenuItem.Click += new System.EventHandler(this.bearbeitenlöschenToolStripMenuItem_Click);<br />
bearbeitenlöschenToolStripMenuItem.Text = "bearbeiten/ löschen";<br />
<br />
personToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] {<br />
erstellenToolStripMenuItem1,<br />
bearbeitenlöschenToolStripMenuItem1});<br />
personToolStripMenuItem.Name = "personToolStripMenuItem";<br />
personToolStripMenuItem.SettingsKey = "Form1.personToolStripMenuItem";<br />
personToolStripMenuItem.Text = "Person";<br />
<br />
erstellenToolStripMenuItem1.Name = "erstellenToolStripMenuItem1";<br />
erstellenToolStripMenuItem1.SettingsKey = "Form1.erstellenToolStripMenuItem1";<br />
erstellenToolStripMenuItem1.Click += new System.EventHandler(this.erstellenToolStripMenuItem1_Click);<br />
erstellenToolStripMenuItem1.Text = "erstellen";<br />
<br />
bearbeitenlöschenToolStripMenuItem1.Name = "bearbeitenlöschenToolStripMenuItem1";<br />
bearbeitenlöschenToolStripMenuItem1.SettingsKey = "Form1.bearbeitenlöschenToolStripMenuItem1";<br />
bearbeitenlöschenToolStripMenuItem.Click += new System.EventHandler(this.bearbeitenlöschenToolStripMenuItem1_Click);<br />
bearbeitenlöschenToolStripMenuItem1.Text = "bearbeiten/ löschen";<br />
<br />
dVDListeToolStripMenuItem.Name = "dVDListeToolStripMenuItem";<br />
dVDListeToolStripMenuItem.SettingsKey = "Form1.dVDListeToolStripMenuItem";<br />
dVDListeToolStripMenuItem.Text = "DVD-Liste";<br />
dVDListeToolStripMenuItem.Click += new System.EventHandler(this.dVDListeToolStripMenuItem_Click);<br />
<br />
verleihToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] {<br />
ausleihenToolStripMenuItem,<br />
geliehenToolStripMenuItem});<br />
verleihToolStripMenuItem.Name = "verleihToolStripMenuItem";<br />
verleihToolStripMenuItem.SettingsKey = "Form1.verleihToolStripMenuItem";<br />
verleihToolStripMenuItem.Text = "Verleih";<br />
<br />
ausleihenToolStripMenuItem.Name = "ausleihenToolStripMenuItem";<br />
ausleihenToolStripMenuItem.SettingsKey = "Form1.ausleihenToolStripMenuItem";<br />
ausleihenToolStripMenuItem.Text = "ausleihen";<br />
ausleihenToolStripMenuItem.Click += new System.EventHandler(this.ausleihenToolStripMenuItem_Click);<br />
<br />
geliehenToolStripMenuItem.Name = "geliehenToolStripMenuItem";<br />
geliehenToolStripMenuItem.SettingsKey = "Form1.geliehenToolStripMenuItem";<br />
geliehenToolStripMenuItem.Text = "geliehen";<br />
geliehenToolStripMenuItem.Click += new System.EventHandler(this.geliehenToolStripMenuItem_Click);<br />
<br />
this.ResumeLayout(false);<br />
}<br />
<br />
<br />
<br />
private void erstellenToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
this.Visible = false;<br />
neu = (Form)forms[0];<br />
neu.ShowDialog();<br />
}<br />
private void bearbeitenlöschenToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
this.Visible = false;<br />
neu = (Form)forms[1];<br />
neu.ShowDialog();<br />
}<br />
private void erstellenToolStripMenuItem1_Click(object sender, EventArgs e)<br />
{<br />
this.Visible = false;<br />
neu = (Form)forms[2];<br />
neu.ShowDialog();<br />
}<br />
private void bearbeitenlöschenToolStripMenuItem1_Click(object sender, EventArgs e)<br />
{<br />
this.Visible = false;<br />
neu = (Form)forms[3];<br />
neu.ShowDialog();<br />
}<br />
private void dVDListeToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
this.Visible = false;<br />
neu = (Form)forms[4];<br />
neu.ShowDialog();<br />
}<br />
private void ausleihenToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
this.Visible = false;<br />
neu = (Form)forms[5];<br />
neu.ShowDialog();<br />
}<br />
private void geliehenToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
this.Visible = false;<br />
neu = (Form)forms[6];<br />
neu.ShowDialog();<br />
}<br />
}<br />
}
|
|
|
|
|
Anonymous wrote:
Arraylist forms = new Arraylist(10);
Form1 for1 = new Form1();
.
.
.
forms.Insert(0, for1);
.
.
.
Are you doing this in the constructor of the forms? If yes thats the problem:
If the Form constructor constructs another form which again does this which again does this which again does this ... and there is your endless loop.
An easy way araound this would be to create a factory class which creates the forms. The first time a form is requested it can instaniate it, for every next call it should pass the already created instance to the caller (singleton).
public class FormFactory {
private Form1 _form1;
private Form2 _form2;
public Form1 CreateForm1() {
if (_form1 == null)
_form1 = new Form1();
return _form1;
}
public Form2 CreateForm2() {
if (_form2 == null)
_form2 = new Form2();
return _form2;
}
}
|
|
|
|