|
I am new to programming .net and i have a project to convert a java servlet that handles the headers and footers of all our websites into a .net dll so all .net apps can use this.
Any suggestions on where to start and/or articles would be appreciated, exspecally concerning the conversion of httpservlet calls.
I have been programming in Java for 3 years, and have limited .net experince, but have been a web dev for 10 years and used to program in vb6. We are using c# though.
Thanks for any suggestions, sorry so vauge.
|
|
|
|
|
You need to look at an HttpHandler. There are many examples easily found in google. Note that this doesn't work across all sites (you will need to install it on a per-site/server basis), and it doesn't cope with none ASP.NET pages.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
there is Visual Studio J# Express Edition 2005, which works with a language that
looks, smells and feels like Java, and integrates well with the other CLR languages.
I don't know how long it will be supported and survive, but it is there now.
I expect it could deliver your .NET DLL in a snap.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: I don't know how long it will be supported and survive
It has been killed, i.e, there will be no new versions. But it will be supported in the usual MS way - extended support with security patches I guess for 10 years from Nov 2005?
Kevin
|
|
|
|
|
Thanks for the info.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
While i understand P/Invoke and have written a few basic function calls, i have no idea how to Invoke a method on an instance of a COM Object. Could anyone give me any pointers as to:
1) How to create an instance of a COM object in .Net
2) How to do a non static P/Invoke on an instance of a given COM object.
Cheers
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
|
Sample XML
----------
<Licenses>
<License SystemIdentifier="1-E44EA87E32A5" HostName="host1" IPAddress="192.168.1.1" ProductName="Installer" />
<License SystemIdentifier="1-E44EA87E32A5" HostName="host1" IPAddress="192.168.1.2" ProductName="MSI Packager" />
<License SystemIdentifier="1-E44EA87E32A5" HostName="host1" IPAddress="192.168.1.3" ProductName="Custom" />
</Licenses>
C# Code (FAILS)
---------------
XmlNodeList nodes = xml.SelectNodes(@"/Licenses/License[@HostName='host1'] and [@IPAddress='192.168.1.2' ]");
XmlNode node = xml.SelectSinglenode(@"/Licenses/License[@HostName='SIN520APP190'] and [@IPAddress='192.168.1.2' ]");
Basically I need to know how to select node(s) by applying filters on 2 or more attributes. It works with single attribute though.
Thanks.
h
|
|
|
|
|
|
XmlNode node = xml.SelectSinglenode(@"/Licenses/License[@HostName='SIN520APP190' and @IPAddress='192.168.1.2'] ");
try this out and c what happens
Rocky
|
|
|
|
|
Thanks Rocky..
xml.SelectSingleNode(@"/Licenses/License[@Att1='xx' and @Att2='xx'] works.
Problem was with my syntax, i was enclosing each attribute within square braces. God bless.
|
|
|
|
|
|
hi all,
i am using a datagridview and set the datasource to a datatable in my windows application. i added a datagridviewcheckboxcolumn representing status for each of my row.
I need to get the values of all rows where checkbox is selected.
i tried the following code
for (int i = 0; i < datagridview1.Rows.Count; i++)
{
DataGridViewCheckBoxCell cell = (DataGridViewCheckBoxCell)datagridview1.Rows[i].Cells[1];
if (cell.value.tostring() == "true")
{
MessageBox.Show(datagridview1.Rows[i].Cells[0].value.tostring());
}
}
if i have two rows in my datagrid, and if i checked both rows only the first row value is displayed. the second row value is not selected.the last row value is not displayed.
can anyone suggest me where i am going wrong? how to implement this?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
for (int i = 0; i < datagridview1.Rows.Count; i++)
{
if(Convert.ToBoolean(dataGridView[i/*rownum*/,ColumnIndex]) == true))
{
//do ur stuff and plz confirm whether the row index and column index are at right place
}
}
hope it helps
|
|
|
|
|
In my project I would like to have a code file that just stores the global variables I will be using.
I added a code file to the project, but i cant declare directly like this:
<br />
int ItemRecordLength = 252;<br />
int SkillRecordLength = 140;<br />
int CharacterRecordLength = 4540;<br />
int InventoryRecordLength = 44;<br />
int RemainingStatPoints = 35;<br />
Is it possible to do this? I want these variables to be usable from any class/form within the project. I hope i made the problem clear
Thanks
|
|
|
|
|
just make a new public class in a new file preferably and declare all thse variables as static. That should do the job for you
|
|
|
|
|
It's best to define them in a static class and use the const modifier, somethink like this:
public static class Constants
{
public const int MyInt = 48000;
Standards are great! Everybody should have one!
|
|
|
|
|
Wow, thanks for the quick replies guys.
I better go read up on static classes ^^
Cheers 
|
|
|
|
|
I forgot to mention, not all of these will be constants, many of them will be modified during runtime, can i still use a static class for that?
|
|
|
|
|
|
yes, but if you want to change them they cant be const .
|
|
|
|
|
Surely you can, but I'm no friend of static what-so-ever because most of the times usage of statics lead to a poorly designed project (but that depends on what you want to do, of course).
Issues of statics:
- Robustness against multi threading
- tight coupling of components or monolithic design (instead of loose coupling)
- all problems that singletons have
However, this is just a design consideration, not a technical problem
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Also you may consider using property to make it neat.
modified 17-Jul-19 21:02pm.
|
|
|
|
|
Hi!
How do we retrieve all the installed softwares in WMI? All means all the softwares being installed in the computer. I used win32_Product yet it only retrieves those microsoft softwares and it even displays everything added to that software like an update.
The following are the needed information:
Softwarename
InstallDate
SotwarePath
AllotedLocationType
RegistryPath
ExecutableFilename
LastUsed
TotalUsageDurationMins
IsUninstalled
IsHotfix
IsServicePack
isUnauthorized
Please help.
Thanks.
-- modified at 7:18 Thursday 16th August, 2007
|
|
|
|
|
You can enumerate keys for path...
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
..and then look for DisplayName, UninstallString and other values as suited.
If you get to know a better way out please do let me know as well
Cheers
H.
|
|
|
|