|
clarification for #2: yes that's exactly what I want to do. I don't think it's possible though, just not sure.
on point #1, I don't think that works as I have tried that already, but if you get it to work, I'd love to see some code examples.
Thanks!
|
|
|
|
|
1) As long as the proper permissions have been applied to the folder I don't see why it shouldn't work
2) You could use some inline script within the head element
<head runat="server">
<%= InsertMeta() %>
</head>
protected string InsertMeta()
{
return @"<meta name='Test' content='Some value' />";
}
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi All.
How to get mac address of a client system in asp.net??
I need to identify client system uniquely other than using IP address.
If there is any other way for achieving the same please suggest...
Thanks and Regards
Mithun Narayanan.
|
|
|
|
|
And it involved this very issue. And a Senior MS Consultant (I hate to admit) showed me the path towards righteousness. Basically, your MAC address gets replaced with each frame along each router or some such non-sense. Meaning that outside your local network the MAC is meaningless. Much worse, some TCP/IP stacks do not even provide it through the API so you would need to really write some code to get it.
http://tools.ietf.org/html/rfc1122[^]
http://en.wikipedia.org/wiki/Ethernet[^]
|
|
|
|
|
In case of ASP.NET it is a client server architecture.. So you can only get things that are sent through request object.
As every request is made by the browser (client) you can add the mac address to it and send it.
So only option is your IP.... which is also the external one.
|
|
|
|
|
Sorry i cant use IP... if am using it i cant uniquly identify systems under a particular network... is ther any other way... i can it thru javascript but i ve to enable ActiveX which i dont want...
is ther any other way.??
|
|
|
|
|
Hi,try to do this.
using System.Management;
string stringMAC = "";
string stringIP = "";
ManagementClass MC = new ManagementClass "Win32_NetworkAdapterConfiguration");
ManagementObjectCollection MOC= MC.GetInstances();
foreach(ManagementObject MO in MOC)
{
if ((bool)MO["IPEnabled"] == true)
{
stringMAC += MO["MACAddress"].ToString();
TextMAC.Text = stringMAC.ToString();
string[] IPAddresses = (string[]) MO["IPAddress"];
if(IPAddresses.Length > 0)
stringIP = IPAddresses[0];
TextIP.Text = stringIP.ToString();
}
}
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:54am.
|
|
|
|
|
Thank u for the response.. i ll try this nd revert ..
|
|
|
|
|
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.
|
|
|
|