|
There are static element in .NET 1.1 but no static classes.
I used to use abstract classes instead of static classes. Some people might say its not clean yet it did the job.
|
|
|
|
|
Hi all,
i looked into several .csproj files today, and i found that node 'EmbeddedResource' are different from each other,i'm curious to know what results in this? anyone have any idea regarding this?
(1)
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
(2)
<EmbeddedResource Include="FormAbout.resx">
<SubType>Designer</SubType>
<DependentUpon>FormAbout.cs</DependentUpon>
</EmbeddedResource>
(3)
<EmbeddedResource Include="CommonText.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>CommonText.Designer.cs</LastGenOutput>
</EmbeddedResource>
|
|
|
|
|
Visual studio uses this information to pass appropriate parameters to the C# compiler to embed these resources during compilation. Whenever you add any embeddable resource to a form (image, etc.), it is serialized and stored in the corresponding .resx file (Form1.resx for Form1.cs).
|
|
|
|
|
Yes, but i mean why they are different? for instance,some have sub-node 'DependentUpon', some don't.
Are there any hidden law here?
|
|
|
|
|
The 'DependentUpon' node is used by the Project Explorer to resolve the tree node under which this file should be grouped. It does not apply to common resource files that are not part of any Form. (That is why there is no DependentUpon node for CommonText.resx)
And there are other nodes that are only applicable to the specific resource files.
|
|
|
|
|
Thank you,Shameel. this answer is what i need.
|
|
|
|
|
How to get MAC Address and IP Address of recent visitor User
|
|
|
|
|
In what context?
Is this in a webservice, web application, windows service, active directory logon, vpn connection, remote desktop connection, citrix environment?
|
|
|
|
|
in the context of web application
|
|
|
|
|
Do you mean the recent visitor of ASP.NET web site?
Life is a stage and we are all actors!
|
|
|
|
|
|
I've taken a quick review of the standart HttpRequest headers, [^] but there isn't anything for MAC addresses so I suppose you can't get User MAC from server side code.You need client side code to do that.I've found this solution based on JavaScript and WMI but it works only with IE because it requires to run ActiveX control on the client side.
Life is a stage and we are all actors!
|
|
|
|
|
To get IP of the visitor, you can use Javascript method: getHostAddress().
Getting Mac address will not be an easy task. I don't how or if you can get that, I am sure it is not easy.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:59am.
|
|
|
|
|
Your answer is out of context. His question was how to find out the client's IP and MAC address from a web server when it connects to the server (not clear though).
|
|
|
|
|
HttpContext currentContext = HttpContext.Current;
string ip = currentContext.Request.UserHostAddress;
The MAC Address is unlikely to be the MAC of the machine browsing the web site. The MAC address of the IP packets changes as the packets pass through routers.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return!
- David Walliams (Little Britain)
|
|
|
|
|
If you get it (and I'm not saying you can), then you would have to be very careful about what you do with it - you could easily break a lot of privacy laws
|
|
|
|
|
In a web application, there is no way to get the MAC address of the client. It wouldn't do you any good either since it only means something to the local subnet that the client machine is attached to.
The MAC address that you might get is going to the from the last network interface to touch the packet before it got to your web server. This is usually the near-side of the last router or firewall that touched the packet before it got to your server. It will also be the same for every packet you get unless there is an alternate route for IP traffic to get to your server.
|
|
|
|
|
There shouldn't be a need for it, but you could ask the visitor for it.
Don't attempt any sort of security or identity based on such addresses.
|
|
|
|
|
I need some help in my project.
I am trying to insert a row in my database table using a SQL query from my dataset.
If I execute the query from query builder, it is able to insert a new row to my database table.
But, as I am trying to use the same query from my code, and try to view the rows from my code (using a getdata() query), the newly inserted row is shown, but if I close the my project, I run it after some time, the recently inserted row is gone ..... I checked the database, but the new row is not there .....
What can be wrong ? Please provide me some guidance ...
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
Can you the insertion code you are using?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
INSERT INTO PatientsDetails
(FirstName, LastName, DateOfBirth, BloodGroupId, Gender)
VALUES (@FirstName,@LastName,@DateOfBirth,@BloodGroupId,@Gender);
SELECT ReferenceId, FirstName, LastName, DateOfBirth, BloodGroupId, Gender FROM PatientsDetails WHERE (ReferenceId = SCOPE_IDENTITY())
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
I modified the above query as
INSERT INTO PatientsDetails
(FirstName, LastName, DateOfBirth, BloodGroupId, Gender)
VALUES (@FirstName,@LastName,@DateOfBirth,@BloodGroupId,@Gender);
Still its happening the same ...
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
This may sound stupid, but are you querying the same DB programatically, and via the SQl query? Have you checked your connection string?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
"Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
|
|
|
|
|
I meant the C# code. If this query is working through management studio, it must be correct. There has to something wrong in your code.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|