|
Running D:/WUSL/4th yr 1st sem/Traffic-Counting-Using-OpenCV-and-Python-Backed-by-Firebase-master/main code.py
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Edu 2018.1.3\helpers\pydev\pydev_run_in_console.py", line 52, in run_file
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm Edu 2018.1.3\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/WUSL/4th yr 1st sem/Traffic-Counting-Using-OpenCV-and-Python-Backed-by-Firebase-master/main code.py", line 10, in <module>
import requests
File "C:\Program Files\JetBrains\PyCharm Edu 2018.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 19, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'requests'
PyDev console: starting.
|
|
|
|
|
Python is nothing to do with ASP.NET - try the Web Development[^] forum instead.
But you're going to need to provide a lot more information than you have here if you want anyone to be able to help you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thilipr wrote: ModuleNotFoundError: No module named 'requests'
Go back to your source code to see why you are trying to import an unknown module.
|
|
|
|
|
Is there some magic I am missing with the select list tag helper
<div style="margin-top:15px;">
<label asp-for="SelectedUserDetails.ModifiedBy" style="font-weight:bold;"></label>
<input type='text' class='form-control' asp-for="SelectedUserDetails.ModifiedBy" />
</div>
<div style="margin-top:15px;">
<label asp-for="SelectedUserDetails.Operator" style="font-weight:bold;"></label>
<select asp-for="SelectedUserDetails.OperatorID" asp-items="Model.OperatorList"></select>
</div>
The first block places the input field BELOW the label. However the second block containing the Select tag helper places the drop down directly directly AFTER the label.
What should I add to get the drop down onto the line below the label?
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Needed to add Form-control to the drop down.
It does annoy me when I spot the solution 30 seconds AFTER I post the question
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I have deployed my web application in IIS today but when I am opening my application with
http://mphidbonline.in/MPHIDBLogin.aspx URL
it is working fine but it is showing
http://mphidbonline.in/(S(hu13w42xoom2xkioqsmr4mv1))/MPHIDBLogin.aspx In URL with extra
path
(S(hu13w42xoom2xkioqsmr4mv1)) could you please give me a suggestion where I am doing mistake.
|
|
|
|
|
|
|
Please help me error when bind data to html datatable, i don't know what's wrong in my code, thx before..
Vb Code
<pre><System.Web.Services.WebMethod()>
Public Shared Function GetListPriority()
Dim client As New HttpClient()
Dim Resp = client.GetAsync(New Uri(ConfigurationManager.AppSettings("WS") + "ListPriority"))
Dim ds = JsonConvert.DeserializeObject(Of List(Of ListPriority))(Resp.Result.Content.ReadAsStringAsync().Result)
Dim details As New List(Of ListPriority)()
For Each i In ds
Dim oListPriority As New ListPriority
oListPriority.PriorityCode = i.PriorityCode
oListPriority.bAktif = i.bAktif
oListPriority.InputBy = i.InputBy
oListPriority.InputDate = i.InputDate
details.Add(oListPriority)
Next
Return details.ToArray
End Function
Public Class ListPriority
Public Property PriorityCode As String
Public Property bAktif As String
Public Property InputBy As String
Public Property InputDate As String
End Class
ASPX
<asp:Content ID="Content" ContentPlaceHolderID="MainContent" runat="server">
<div id="content-wrapper">
<div class="card mb-3">
<div class="card-header">
/ Master / Priority
<div style="float: right">
<button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#myModal">NEW</button>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Priority Code</th>
<th>bAktif</th>
<th>Input By</th>
<th>Input Date</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Priority Code</th>
<th>bAktif</th>
<th>Input By</th>
<th>Input date</th>
</tr>
</tfoot>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
</div>
</div>
</asp:Content>
JavaScript
<script src="../vendor/jquery/jquery.min.js"></script>
<script src="../Scripts/demo/datatables-demo.js"></script>
<script src="../vendor/datatables/jquery.dataTables.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Priority.aspx/GetListPriority",
data: "{}",
dataType: "json",
success: function (data) {
var trHTML = '';
for (var i = 0; i < data.d.length; i++) {
trHTML += '<tr><td>' + data.d[i].PriorityCode + '</td><td>' + data.d[i].bAktif + '</td><td>' + data.d[i].InputBy + '</td><td>' + data.d[i].InputDate + '</td></tr>';
;
};$('#dataTable tbody').append(trHTML)},
error: function(result) {
alert("Error");
}
});
});
</script>
And show like this :
Image
|
|
|
|
|
I don't know what's wrong either because I don't see where you posted the actual error message.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
You're referencing the DataTables.net[^] library, so why are you building the table by hand? That library can automatically load the table data for you from an AJAX request:
DataTables example - Ajax data source (objects)[^]
Also, check the content of your datatables-demo.js file; there's nothing in the code you've shown which would display that message.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have a web application made with ASP.net and VB. I want to print a receipt from my web application to a Bluetooth printer (Using an android device)
I've no idea how I do it. Please help
|
|
|
|
|
Where is the printer connected, server or client?
|
|
|
|
|
Is it possible to navigate a Razor web site without displaying the details in the URL
https://localhost:44351/UserDetails?id=1
The id=1 seems to be a security risk as changing the id will show another users details or is this caught by using API security (currently not implemented)
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
|
Thanks for the link - makes a lot of sense.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
To be exploited, an IDOR issue must be combined with an Access Control issue because it's the Access Control issue that "allow" the attacker to access to the object for which he have guessed the identifier through is enumeration attack.
So long as you have proper access controls in place, and return the same error for accounts that the current user doesn't have permission to access as for accounts which don't exist, there shouldn't be any problems.
Depending on what you're doing, you might be able to drop the querystring and deduce the record to display based on the currently logged-in user. Or you could replace the IDs with a Guid, which would be much harder to enumerate.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Access control is something I have not implemented yet, still working on the nuts and bolts.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Greetings again,
I have an asp.net web app and have been tasked with validating user log in through Active Directory.
I have been working on this part now for almost two days with no success.
Here is what I have been working on.
I created a table called ADSI_Table
This table has two fields, ParamName and ParamValue:
Here is the complete table info:
ParamName ParamValue
WindowsDomainServer pcg.porto.loc
BaseDN DC=pcg, DC=porto, DC=loc (Base DN)
UserDN OU=InformationSystems (User DN)
GroupName CN=ITTESTAPP, OU=IT-Groups, DC=pcg, DC=porto, DC=loc
AccountFilter sAMAccountName
The DB Server is configured to talk to Active Directory Server.
Then I am using the following C# code to query this table:
protected void btnSubmit_Click(object sender, System.EventArgs e)
{
if (txtUserName.Text.Trim().Equals("") || txtPassword.Text.Trim().Equals(""))
{
Message.Text = "Please Enter UserName/Password...";
txtPassword.Text = "";
txtUserName.Text = "";
}
else
{
GetADSILogin();
}
}
public void GetADSILogin()
{
try
{
string strServerName = "";
string strBaseDN = "";
string strUserDN = "";
string strGroupName = "";
string strAccountFilter = "";
string strPortNo = "389";
Boolean blnGroupUser = false;
string source = "Data Source=myDBServerName;Initial Catalog=MyDB;user=mysusername;password=myPassword";
string select = "SELECT * from ADSI_Table";
SqlConnection conn = new SqlConnection(source);
conn.Open();
SqlCommand cmd = new SqlCommand(select, conn);
SqlDataReader myReader = cmd.ExecuteReader();
if (myReader.HasRows)
{
while (myReader.Read())
{
string strParameterName = myReader.GetString(0).Trim();
string strParameterValue = myReader.GetString(1).Trim();
if (strParameterName.ToUpper().Equals("SERVERNAME"))
strServerName = strParameterValue;
if (strParameterName.ToUpper().Equals("BASEDN"))
strBaseDN = strParameterValue;
if (strParameterName.ToUpper().Equals("USERDN"))
strUserDN = strParameterValue;
if (strParameterName.ToUpper().Equals("GROUPNAME"))
strGroupName = strParameterValue;
if (strParameterName.ToUpper().Equals("ACCOUNTFILTER"))
strAccountFilter = strParameterValue;
}
}
DirectoryEntry deSystem = new DirectoryEntry("LDAP://" + strServerName + "/" + strUserDN + "," + strBaseDN);
deSystem.AuthenticationType = AuthenticationTypes.Secure;
deSystem.Username = txtUserName.Text;
deSystem.Password = txtPassword.Text;
string strSearch = strAccountFilter + "=" + txtUserName.Text;
DirectorySearcher dsSystem = new DirectorySearcher(deSystem, strSearch);
dsSystem.SearchScope = SearchScope.Subtree;
SearchResult srSystem = dsSystem.FindOne();
ResultPropertyValueCollection valcol = srSystem.Properties["memberOf"];
if (valcol.Count > 0)
{
foreach (object o in valcol)
{
if (o.ToString().Equals(strGroupName + "," + strBaseDN))
{
blnGroupUser = true;
break;
}
}
}
if (blnGroupUser == true)
Message.Text = "Login Sucessfull...";
else
Message.Text = "User Does Not Belong to Specified ADSI Group";
}
catch (Exception ex)
{
Message.Text = (ex.Message);
}
int i = 0;
i = i + 1;
if (i == 5)
{
Message.Text = "Login failed for 5 times. Quiting...";
this.Close();
}
}
When a user attempts to login and the log in is successful, the user is redirected to search page although I have not put the redirect code yet as I am busy testing authentication.
If the user does to belong to the specified Active Directory group, the user gets the following message:
User Does Not Belong to Specified AD Group.
So far, that's all I keep getting.
I have run the AD tree and attributes the infrastructure folks who set up the AD and they have confirmed that the entries are correct.
Can someone please tell me what could be wrong with my code or am I missing a key component?
Many thanks in advance.
|
|
|
|
|
If the account that is running the code does not have the proper permissions you can get nothing back from AD with no error. So, I would validate the permissions you have.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
@ZurdoDev,
Thank you very much for your input.
I will have our Admin folks look into this although I don't necessarily that is true in my case.
The group that the account (mine, I assume that's what you mean) is trying to log into exists there.
|
|
|
|
|
Also try an ldap query tool that will allow running queries directly so you can make sure your actual query works.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Assuming your variables are well-named, you're doing a subtree search off of a full DN. You want a search scope of "Base". A user object has no subtree; it's not a container like an OU.
Another suggestion, your structure is highly coupled and can be easily jacked up by very minor changes to the directory. Assuming that you're using a SAM Name for login, you can completely skip the SQL server.
If you really need the SQL, though, you're doing it wrong. Use a parameterized query to leverage the DBMS rather than pulling the whole table and iterating it locally. So many wasted cycles!
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
Hello,
I am using ASP.NET MVC in one of my projects. I want to import an Excel file from the local computer and store it on the server and also want to export the Excel file. How do I do import and export of excel file in ASP.NET MVC?
|
|
|
|
|
There are many different ways of doing it and it will depend on what controls you already have or how you want it to work.
Where are you stuck?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|