|
ha ha ...
this will give you the Mac address of the Server. ..
|
|
|
|
|
i knw tat... i ve tried it long back ago...
|
|
|
|
|
Hi, you can refer to the following code:
[DllImport("Iphlpapi.dll")]
private static extern int SendARP(Int32 dest,Int32 host,ref Int64 mac,ref Int32 length);
[DllImport("Ws2_32.dll")]
private static extern Int32 inet_addr(string ip);
private void Page_Load(object sender, System.EventArgs e)
{
// initial page
try
{
string userip=Request.UserHostAddress;
string strClientIP = Request.UserHostAddress.ToString().Trim();
Int32 ldest = inet_addr(strClientIP); //client ip
Int32 lhost = inet_addr(""); //server ip
Int64 macinfo = new Int64();
Int32 len = 6;
int res = SendARP(ldest,0, ref macinfo, ref len);
string mac_src=macinfo.ToString("X");
if(mac_src == "0")
{
if(userip=="127.0.0.1")
Response.Write ("Localhost!");
else
Response.Write ("welcome IP = " + userip + "<br>");
return;
}
while(mac_src.Length<12)
{
mac_src = mac_src.Insert(0,"0");
}
string mac_dest="";
for(int i=0;i<11;i++)
{
if (0 == (i % 2))
{
if ( i == 10 )
{
mac_dest = mac_dest.Insert(0,mac_src.Substring(i,2));
}
else
{
mac_dest ="-" + mac_dest.Insert(0,mac_src.Substring(i,2));
}
}
}
Response.Write ("welcome IP = "+userip+ "<br>" + ",MAC = "+mac_dest
+ "<br>");
}
catch(Exception err)
{
Response.Write(err.Message);
}
}
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:54am.
|
|
|
|
|
Thank u for the response..
|
|
|
|
|
Hi all,
I need to add more data separated by commas in one cell in a Gridview. I capture the data from the textboxes and save into the Gridview but for Cas No textbox, I need to add more than one value.I have another Add button next to this textbox to add more data. I don't know how to do achieve this. I'd appreciate any help/advice.
Here is my Code:
private void DataBindGridCases()
{
try
{
DateTime date = new DateTime();
//Create DataTable.
DataTable dt = (DataTable)Session["dtCaseDetails"];
if (dt == null)
{
//Create DataTable.
dt = new DataTable();
//Assign Columns to it.
dt.Columns.Add(new DataColumn("Province"));
dt.Columns.Add(new DataColumn("City"));
dt.Columns.Add(new DataColumn("Station"));
dt.Columns.Add(new DataColumn("Cas No"));
dt.Columns.Add(new DataColumn("Investigating Officer"));
dt.Columns.Add(new DataColumn("Name of Court"));
dt.Columns.Add(new DataColumn("Date"));
}
//Create a DataRow by dt.NewRow().
DataRow dr = dt.NewRow();
if (chkCourtDate.Checked)
{
//Fill that row and add it to datatable.
dr["Province"] = txtProvince2.Text;
dr["City"] = txtCity.Text;
dr["Station"] = txtStation.Text;
dr["Cas No"] = txtCasNo.Text;
dr["Investigating Officer"] = txtInvestOfficer.Text;
dr["Name of Court"] = txtNameOfCourt.Text;
DateControl.PopulateEntity(ref date);
dr["Date"] = date;
dt.Rows.Add(dr);
}
else
{
dr["Province"] = txtProvince2.Text;
dr["City"] = txtCity.Text;
dr["Station"] = txtStation.Text;
dr["Cas No"] = txtCasNo.Text;
dt.Rows.Add(dr);
}
Session["dtCaseDetails"] = dt;
//Bind GridView Here with this Table
this.BindDataCase();
//clear the textboxes
this.ClearTextboxes();
//Rename the button
btnSave.Text = "Add Another Case";
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
private void BindDataCase()
{
//Bind GridView Here with this Table
this.dgCaseDetails.DataSource = Session["dtCaseDetails"];
this.dgCaseDetails.DataBind();
}
Thank you in advanced.
|
|
|
|
|
Append the value from the textbox to the column in the data datatable. What are you having difficulty with?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I need to do a project using the gsoap source,
I write the client code in the gsoap system, I want to try that if the system network is disconnected and then connected, whether the data can be received inside the time.
Anyother problem is how to test the how much percent of network is used when using gsoap to receive data from Web site?
does anyone can help me ?
thanks
|
|
|
|
|
The code is following, I need to count how much bandwidth that this program uses.
struct soap soapService;
soap_init(&soapService);
soapService.accept_timeout = 60;
soapService.recv_timeout = 60;
soapService.send_timeout = 60;
soapService.connect_timeout = 60;
int result = -1;
_ns1__QueryPerson queryPerson;
_ns1__QueryPersonResponse *queryPersonResponse;
const char* s1 = "fish";
std::string stdstr(s1);
queryPerson.name = &stdstr;
queryPersonResponse = new _ns1__QueryPersonResponse();
const char* server = "http://192.168.140.127/classmate/Service.asmx";
result = soap_call___ns2__QueryPerson(&soapService, server, "", &queryPerson, queryPersonResponse);
if(soapService.error)
{
soap_print_fault(&soapService,stderr);
result = soapService.error;
}
if (result == SOAP_OK)
{
cout <<"收到数据:[" << endl;
}
else
{
printf("soap error ,errcode = %d\n", result);
}
soap_destroy(&soapService);
soap_end(&soapService);
soap_done(&soapService);
delete queryPersonResponse;
|
|
|
|
|
Hi friends
I have created a gridview using ITemplate to generate textboxes in cells and to display the data. The grid is bound using a datatable in PreRender event.
On Page refresh the modified value gets replaced by the existing value from datatable. If I do not bind the gridview in each refresh, the textboxes gets vanish from the gridview.
Can any one help me to overcome this problem.
Does viewstate will have any role in this?
Thanks in advance
Shivanandan C V
|
|
|
|
|
Hey
Nobody is there to help me? Please give any suggetions atleast.
Thanks
Shivanandan C V
|
|
|
|
|
Everyone here is unpaid, we answer questions as and when we can. If you have not received an answer it is because nobody who knows the answer has read it.
Bob
Ashfield Consultants Ltd
Proud to be a Code Project MVP
|
|
|
|
|
That's right. If there is no value, the gridview will disappear from gui.
You can try to set EnableViewState="false".
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:55am.
|
|
|
|
|
Thanks for you reply.
Is there any event in which, the typed value on the textbox is accessible? So that I can update the data table from that. Then on rebinding I will get the last typed value again.
Thanks
Shivanandan C V
|
|
|
|
|
Hi
am using a dll in my web project ("Owc11.dll")
Before upgrading our production server (32 bit) it was working fine. So, recently
our production server has been upgraded to 64 bit. So, while running the
application one error throwing like this:
"retrieving the COM class factory for component with CLSID {0002E55D-0000-0000-C000-000000000046} failed due to the following error: 80040154"
Thanks & Regards,
Jeneesh K. Velayudhan
|
|
|
|
|
I dont think this dll would work for 64 bit machine.This issue is also faced by other ones also..
click here
Click here2
Cheers!!
Brij
|
|
|
|
|
Yes, it willn't work in 64 bit machine. Do you know, any solutions for this ?
Thanks & Regards,
Jeneesh K. Velayudhan
|
|
|
|
|
You have to make your web app run under 32 bit explicitly or it will not be able to call Owc11.dll ie. Compile it to target x86 cpu.
You will also have to set Enable32BitAppOnWin64 in IIS for the application pool that the web application uses. I think the ManagedPipelineMode on the appPool should be set to false as well.
|
|
|
|
|
How can we compile a dll ? we are using a thrid party dll, we dont have the source code for the dll.
Also, we are using IIS 6.0 in windows 2003 server. If we set Enable32BitAppOnWin64 on IIS
6, every applications hosted in IIS 6.0 will work in 32 bit. Applications in IIS 6.0 will
not support both modes simultaneously, right ?
Thanks & Regards,
Jeneesh K. Velayudhan
|
|
|
|
|
I have deploy my web application in IIS 7.0 and I get below error
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
It is possible that a handler mapping is missing. By default, the static file handler processes all content.
The feature you are trying to use may not be installed.
The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)
If ASP.NET is not installed.
|
|
|
|
|
IIS7 is not configured properly.
pls configure that one correctly and deploy it.
Sathesh.
Blessed is the season which engages the whole world in a conspiracy of love.
|
|
|
|
|
|
Ok guys, so this one is sort of hard to describe, but here it is...I have a label inside a div. The div tag has a style element which is setting up fonts and stuff like that on the label....the text of the label is set somewhere else, it's a separete mechanism similar to resx files...so I can't just simply say <h1> Blah blah </H1>...so I need to set some property either on the label itself, or on the div tag that can display the text as H1 heading.
This is what it has in the style attribute of the div
<pre><div style="margin: 0px; font-family: Tahoma, Arial, Verdana, sans-serif; font-size: 11px; font-style: normal; font-variant: normal; border-bottom: white 5px solid;">
<asp:Label ID="lblMyLabel" Font-Bold="True" runat="server" />
</div></pre>
I know it's gotta be pretty simple, but i can't seem to find the right property to set either on the div or on the label which will convert the text size to H1.
I realize that i can accomplish the same using font size or somethihng else, but they want to be able to see <h1> tag around the text of this label, when viewing the view source (rendered html).
Any thoughts please!
|
|
|
|
|
Well, h1 is a tag not a property. so you cannot set it to your Label control.
I could suggest the following:
1. Instead of Label, use h1 tag with runat="server" and a unique id. Then you can
access and change the header from you code behind.
<h1 id="MyHeader" runat="server"></h1>
MyHeader.InnerHtml = "Blah Blah Blah...";
2. Instead of using Label, use Literal Control and form the tag from
where ever in code behind you want.
Hope this will help.
|
|
|
|
|
I have an asp label in a table as shown below. The label text is set in the codebehind. I would like the table column to stretch when the label text is to long to fix instead of it wrapping to the next line. How can this be accomplished?
<table cellpadding="0" cellspacing="0" style="width: 100%;">
<tr>
<td style="width: 250px">>
<asp:Label ID="Label2" runat="server" Text="Label" Font-Size="9pt"></asp:Label>
|
|
|
|
|
You're getting just what you've asked for. The width is set to a specific value, 250px, and the rendering engine is honoring that. Remove the width or possibly use a percentage rather than a fixed value.
I know the language. I've read a book. - _Madmatt
|
|
|
|