15,896,348 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by maysam_p82 (Top 79 by date)
maysam_p82
4-Aug-23 10:23am
View
Actually, I provided all of the dependencies, dbcontext,... but there are lots of inheritances inside classes. But I still don't know why I face such an error. I have searched it for over 2 days. But I didn't find anything similar to my error on the Internet. I guess it looks for a dependency for Identity! Is there any other way to initialize my variables without DI?
maysam_p82
1-Apr-20 12:12pm
View
Now the binding is like this :
<binding protocol="http" bindinginformation="*:80:*">
but it still doesnt work with 127.0.0.1:51036
maysam_p82
1-Apr-20 11:43am
View
No I ve already disabled the firewall. But I think the problem is that IIS refuses all requests on 127.0.0.1 (as it s a vital for android and is another meaning of 10.0.2.2)
how to enable it ? I ve used some methods such as applicationhost.config and tried to change this file but I wasnt success.
maysam_p82
1-Apr-20 11:39am
View
Right now I tested the URL under IP:127.0.0.1 and it returns:
<title>Bad Request
Bad Request - Invalid Hostname
HTTP Error 400. The request hostname is invalid.
maysam_p82
1-Apr-20 11:30am
View
how to find out the reason service app rejects the request from ip 10.0.2.2?:(
maysam_p82
1-Apr-20 11:22am
View
No my web service doesnt call another. I tested the url with Postmane and it works fine. With(localhost)
maysam_p82
1-Apr-20 10:51am
View
I think Postman should see my service from the view of Android Emulator. Does it tell us as well?
maysam_p82
1-Apr-20 10:50am
View
yes, But is there any other way to understand the problem? And will Postman tell us about the undergoing problem?
maysam_p82
1-Apr-20 10:44am
View
That's true but I m not sure if Postman can consume 10.0.2.2 Android specific IP address. Anyway, I'm gonna try it right now.
maysam_p82
1-Apr-20 10:41am
View
But the problem is that I face the "Error 400 bad request" in mobile app before I enter the service, and I think the emulator cant see the 10.0.2.2 at all. Because when I put the IP in the emulator chrome browser I face this error.:(.
maysam_p82
1-Apr-20 10:33am
View
This is the code I have consumed in SOAP:
[WebMethod]
public string GetListInfo_GeneralCategory()
{
string strFolderPath = "\\Areas\\Admin\\UploadedFiles\\GeneralCategories\\";
List<generalcategory> lstGeneralCategory = new List<generalcategory>();
lstGeneralCategory = mapSyncWebService.GetListInfo_GeneralCategory();
if (!string.IsNullOrEmpty(mapSyncWebService.errMessage))
{
return string.Empty;
}
if (lstGeneralCategory.Count == 0)
return string.Empty;
if (Directory.Exists(Server.MapPath(strFolderPath)))
{
string[] arrFilePaths = Directory.GetFiles(strFolderPath);
for (int i = 0; i < lstGeneralCategory.Count; i++)
{
foreach (var strFileName in arrFilePaths)
{
if (strFileName.Split('_')[0] == "imgGeneralCategory" && strFileName.Split('_')[1] == lstGeneralCategory.ElementAt(i).ImageFilePath.Split('_')[1])
lstGeneralCategory.ElementAt(i).ImageBytes = File.ReadAllBytes(Server.MapPath(strFolderPath + "\\" + strFileName)).ToString();
}
}
}
return JsonConvert.SerializeObject(lstGeneralCategory);
}
maysam_p82
1-Apr-20 10:32am
View
this is the URL from Mobile app: http://10.0.2.2:51036/Areas/Admin/WebServices/SyncWebService.asmx
string strRawJson = string.Empty;
string strJsonString = string.Empty;
DataTable dtValues = new DataTable
{
TableName = "dtGeneralCategory"
};
try
{
syncWebService.Url = "http://10.0.2.2:51036/Areas/Admin/WebServices/SyncWebService.asmx";
strRawJson = syncWebService.GetListInfo_GeneralCategory();
}
catch (Exception ex)
{
var alert = new Android.App.AlertDialog.Builder(this);
alert.SetMessage("خطا در برقراری ارتباط با سرور! ");
alert.SetPositiveButton("بستن", delegate { return; });
alert.Create().Show();
return false;
}
var response = JsonConvert.DeserializeObject(strRawJson);
strJsonString = response.ToString();
dtValues = (DataTable)JsonConvert.DeserializeObject(response.ToString(), (typeof(DataTable)));
maysam_p82
1-Apr-20 10:30am
View
But, I have tested it with another MVC application, (obviously with local host:http://localhost:51036/Areas/Admin/WebServices/SyncWebService.asmx)
it works pretty fine.
maysam_p82
9-Oct-18 1:36am
View
Thank you for your response. But here my application is a windows service . There is no asp.net web page. Also the json contains an image with black background with a text for traffic signs. I already could retrieve the image from json but the font is too big and the text didnt palce at the middle of the background.
maysam_p82
8-Oct-18 5:15am
View
Deleted
I mean directly is: bitmap= Deserialize(json);
maysam_p82
28-Mar-18 0:36am
View
yess it worked , thank you so much for your help
maysam_p82
27-Mar-18 9:44am
View
thank you very much, but I didnt understand what did your method does?:(
and if I was going that the method catch when I write "/employment" every where at the url then what should I do?
I want to this work when the user types www.website.com/employment
maysam_p82
27-Mar-18 8:57am
View
Deleted
the short form is website/employment I want to redirect to /WebSites/Employment/Employment.aspx page.
maysam_p82
27-Mar-18 8:56am
View
can u show me an example of it?
maysam_p82
22-Dec-17 5:20am
View
I have explained above about this. Finding the largest number in an array in parallel. Can u please check the code and refine it? I think it has a bit bug.
maysam_p82
21-Dec-17 13:51pm
View
Can u help me please?
maysam_p82
21-Dec-17 12:50pm
View
I have changed the algorithm as you said but I cant still run it. Can u please help me? Im going to represent it tomorrow. thank you
maysam_p82
21-Dec-17 12:48pm
View
import multiprocessing as mp
from multiprocessing.pool import ThreadPool
class Max:
@staticmethod
def subset_max01(arr, n, cpucount):
largest = 0
for i in range(0, n/cpucount):
if arr[i] > largest:
largest = arr[i]
return largest
@staticmethod
def subset_max02(arr ,n ,cpucount):
largest = 0
for j in range(n/cpucount, cpucount):
if arr[j] > largest:
largest = arr[i]
return largest
if __name__ == '__main__':
cpu_count = mp.cpu_count()
print("Number of CPUs: ", cpu_count)
a = []
cpuQueue = []
num = input("Enter how many elements? ")
for i in range(int(num)):
n = input("Enter a[] array: ")
a.append(int(n))
objMax = Max()
pool = mp.Pool(processes=cpu_count)
while cpu_count >= 1:
pool = ThreadPool(processes=2)
cpuQueue.append(pool.apply_async(objMax.subset_max01, (a, num, cpu_count,)))
cpuQueue.append(pool.apply_async(objMax.subset_max02, (a, num, cpu_count,)))
cpu_count = cpu_count-1
larger = 0
for i in range(0, len(cpuQueue)):
if cpuQueue[i] > larger:
larger = cpuQueue[i]
cpuQueue.remove(cpuQueue[i])
cpuQueue.append(larger)
output = [p.get() for p in cpuQueue]
print("Maximum is: ", output)
pool.close()
pool.join()
maysam_p82
21-Dec-17 8:59am
View
how do I allocate a subset to a process? with which statement?
maysam_p82
10-Aug-17 14:57pm
View
Does MVC note that if the password was not hash, then it doesnt allow the Modelstate.Isvalid being true?
maysam_p82
10-Aug-17 14:55pm
View
But I never used any hash algorithm in my application
maysam_p82
10-Aug-17 14:40pm
View
what do you mean?
maysam_p82
26-May-17 13:32pm
View
Ok . Then how can I replace the code with something right? I want to when user clicked on a product , redirect him to relevant page. Do I create a controller? and what should I place in that controller?
maysam_p82
26-May-17 12:51pm
View
so what can I do?
maysam_p82
26-May-17 12:14pm
View
Yes Im sure. So can you help me? This is only an <a href ... storefront/index/3
maysam_p82
8-Apr-17 9:05am
View
And is it possibly from rout config?
maysam_p82
8-Apr-17 9:05am
View
No I am passing two parameters. what can I do?
maysam_p82
4-Apr-17 11:34am
View
In this application, when you going to the instructors page, you have 4 action links
Select|Edit|Details|Delete|
everything is ok until you click on the "select", when click on the select link you should see in bottom of the page courses taught by selected instructor in a table. But only you can see the table headers. and when I putted breaking point , I found that the coursID passed to the action is null but Id not.
maysam_p82
4-Apr-17 3:29am
View
yes ,works. but ,we have another section in the page that shows course taught by the instructors , that this when courseID passing to the controller and it has null value.
maysam_p82
20-Jan-17 5:56am
View
What parameter I should pass to the controller from view?(Id or Model)
maysam_p82
17-Jan-17 7:45am
View
So I want to ask another question; is needed CourseId we declare in our viewmodel? So what is the built in id that is auto generated in sql tables?? That's some confused.
maysam_p82
17-Jan-17 5:33am
View
You mean I should create 3 viewmodels containing student,course,and studentcourses?
maysam_p82
14-Feb-16 4:09am
View
Please help me
maysam_p82
10-Feb-16 6:33am
View
I putted the User.aspx web form out from the folder "User" then it worked perfect!!!! Why?
So far we had Response.redirect("User/User.aspx"); and now we have Response.Redirect("User.aspx");
maysam_p82
10-Feb-16 4:02am
View
Because if I use RedirectFromLoginPage,asp.net takes the user to one page that I have not any control on it,for example I placed some controls on the user page like image control. Now any user that log in the profile picture changes, and the username including welcome message changes depending on user credentials.
maysam_p82
10-Feb-16 3:45am
View
I checked it again, I have see that I'm not redirected at all! I stayed at login page, only the url has changed:http:
//localhost:23407/GarnetGalleryCollection/login.aspx?ReturnUrl=%2fGarnetGalleryCollection%2fUser%2fUser.aspx
maysam_p82
9-Feb-16 16:14pm
View
Yeah, the user.aspx does not show the controls it should show. May be I m not getting to user.aspx,but I saw when redirecting that in address bar , the url has changed, but the contents has not rendered, and the empty white page has displayed to me.So , I want to ask you a question that now came to my mind, is this logic is good that we place one asp.net form like user.aspx in our applications, and after each login and after pass all security considerations , we redirect the user to this user.aspx web form? Or this will not answer for a real world application? I have read many articles, but there is some thricks that are not in articles, and result in experience. If you tell me some thrick to write this parts of apps thank you very much.
maysam_p82
6-Oct-15 5:52am
View
Ok , I have to read this article and I'll come back to you if I couldn't find my answer in this article.Thank you.
maysam_p82
3-Apr-15 14:58pm
View
than you, it worked
maysam_p82
3-Feb-15 9:26am
View
This is my solution:
storedprocedure:
USE [D:\PROGRAM FILES\MAYSAM\CSHARP PROJECTS\TRAINING\GARNETGALLERYCOLLECTION\APP_DATA\GARNETGALLERYWEBSITE.MDF]
GO
/****** Object: StoredProcedure [dbo].[SelectUserPassExist] Script Date: 02/03/2015 17:10:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <author,,name>
-- Create date: <create date,,="">
-- Description: <description,,>
-- =============================================
ALTER PROCEDURE [dbo].[SelectUserPassExist]
@Usr nvarchar(max),
@Pass nvarchar(max),
@Results int Output
AS
BEGIN
set @Results=(select count(*)from Users where ([UserName]=@Usr and [Passcode]=@Pass))
end
and my codebehind:
protected void Button1_Click(object sender, EventArgs e)
{
int intResult;
if ((intResult >1)||(intResult<1))
<!--1--> {
lblMsg.Text = "Invalid Username or Password.";
}
else
{
{
Session["Usr"] = txtUsername.Text;
FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, chkRememberMe.Checked);
}
}
}
private int CheckUserPass(string strUsr, string strPass)
{
int retVal;
string strConnectionString = ConfigurationManager.ConnectionStrings["GarnetWebsiteConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(strConnectionString);
SqlCommand com = new SqlCommand();
com.Connection = con;
com.CommandType = CommandType.StoredProcedure;
com.CommandText = "SelectUserPassExist";
com.Parameters.Add("@Results", SqlDbType.Int, 4);
com.Parameters.AddWithValue("@Usr", strUsr);
com.Parameters.AddWithValue("@Pass", strPass);
com.Parameters["@Results"].Direction = ParameterDirection.Output;
con.Open();
com.ExecuteNonQuery();
retVal = (int)com.Parameters["@Results"].Value;
con.Close();
return retVal;
maysam_p82
3-Feb-15 5:13am
View
Is my code behind is error free? I think I've made some mistake in my code would you check it?
maysam_p82
3-Feb-15 5:11am
View
So you know I want that check the username and password user entered, store username in a session and redirect the user to a specific page , and check weather username and password exist in the database or not please insert a sample that I find how could I do that myself.
maysam_p82
3-Feb-15 5:00am
View
I changed the code with nvarchar(max) but now stored procedure returns the value "0" instead "-3" or if exists "2" but doesn't do that!
maysam_p82
16-Dec-14 9:11am
View
wow thnks, but ,what about to create profile page? Is it an .aspx page, and changes every time a user registered? Or an aspx page is created for every user is registered?
maysam_p82
16-Dec-14 9:07am
View
Is any method other than Response.Redirect() for login users?
maysam_p82
16-Dec-14 9:04am
View
In fact the things that I don't know is that when a user logged in then what should I do to secure transferring him to a his/her profile?
maysam_p82
9-Dec-14 8:40am
View
:( I could not use that, please explain more. What is asmx? I typed in that in google but nothing got me useful.
maysam_p82
9-Dec-14 8:13am
View
can use that in vs2008?
maysam_p82
9-Dec-14 8:12am
View
ok thank you
maysam_p82
9-Dec-14 8:10am
View
Please show me another way to do whithout MVC. A simple traditional way.
maysam_p82
9-Dec-14 7:54am
View
Honestly, I dont understand the articles about profiles and membership , because these articles are not compatible with my ideas, and are very complicated.I want to create that by myself with good security configuration. I dont like the default visual studio UI for register and log in wizards.
maysam_p82
9-Dec-14 7:48am
View
Better say, a simple complete profile.
maysam_p82
9-Dec-14 7:47am
View
My issue is when I want to create a new user I want to create a new page automatically,and that page contains the user information, pictures of that user and so on immediately.
maysam_p82
21-Nov-13 5:48am
View
Thanks for your attention,but this type of code is in VB, I want C# one. Thanks
maysam_p82
16-Jan-13 11:00am
View
Is anyone knows its solution?:(
maysam_p82
26-Dec-12 12:58pm
View
So can u tell me that what is server explorer role in thi scenario?because I was defined another database in server explorer and also a table and finally i couldnt work with it. And Also I didn't understand app_data's role. Because , once I copied and pasted my database file in app_data , then in sql server attached it,I received error,and icouldn't attach DB file from even another folder at all ! In addition , SQL server connection and authentication are a little bit complicated,and depends to various aspects that is hard to understand for me!
maysam_p82
26-Dec-12 10:15am
View
Thank u,that was not for the technical problems,I've reboot my machine and the problem fixed. My app finally executed.
maysam_p82
26-Dec-12 8:45am
View
Because it seems asp suspends while sql respond,I think.
maysam_p82
26-Dec-12 8:44am
View
Is this error for connection timeout parameter?
maysam_p82
26-Dec-12 8:41am
View
Tnx,i think my problem has solve ,I have mistake in connecting to DB.I've created a DB with the same name(Pubs) and I did not fill in data in tables.;) Because I thought asp connect in to the app_data DB not in sql server folders.Anyway I filled the table now,but when it tries to load the page send me this error:
"unable to start program: http://localhost:1077/ExAsp/Default.aspx
Element not found"
maysam_p82
26-Dec-12 8:15am
View
But so why I didn't receive any error about it?also i think did that earlier and I could not connect to DB. Also i hear the app looks for a DB in app_data folder in asp ones.
maysam_p82
26-Dec-12 8:01am
View
why i cant attach any database in sqlserver in another folder?I was received error about permissions and so on,and that forced me to use server explorer instead.
maysam_p82
26-Dec-12 7:56am
View
I tried that earlier,but I could not attach my database,in another folder like ap_data. But I read in my book that I can do the same in server explorer as good. Second, why in my app. I didn't receive exception once app connected to DB while I didn't attach my DB in sql server express2008?
maysam_p82
26-Dec-12 7:47am
View
In server explorer?
maysam_p82
26-Dec-12 7:46am
View
Should I did something else other than creating database,place in app_data folder,creating connection string and creating table ,assigning data to that?
maysam_p82
26-Dec-12 7:44am
View
<add name="Pubs" connectionstring="data source=localhost\SQLEXPRESS;initial catalog=Pubs;integrated security=SSPI">
this is my string placed in the web.config
Also I tested another application that give the server version,and that worked successfully. I don't know why it doesn't work properly:(.
please help me
maysam_p82
26-Dec-12 7:03am
View
I think dataReader couldn't find any data at the table.also i must say that i cant attach database in sqlserverexpress,Im using server explorer as good.
but im not sure every thing is okay about this kind of use.
maysam_p82
26-Dec-12 6:58am
View
i have more record stored in the table.
I don't have any message at the lblResult.
also,I said compiler does not go into the while loop
maysam_p82
26-Dec-12 6:43am
View
Compile pointer goes to while loop and then jump to the con.close() method. without error.
maysam_p82
24-Jan-12 14:27pm
View
thanks for your attention,but ,unfortunately i couldn't understand your approach and your code.I'm not experienced enough to understand these partial codes! I was read MSDN and I found a temporary way,a property,Control.CheckForIllegalCrossThreadCalls = false; . This is for .NET Framework 1.1 that also my book is for.But I found that is not an appropriate way for Multithreading programming.But in my this special discussion Threads was not target. Network programming was my target. Although, I'm interested in learning thread,and I request you show me some simpler and more realized samples ,thank you so much.Thanks for your attention.:-)
maysam_p82
22-Jan-12 15:30pm
View
But still i dont know i should use begininvoke()instead of what ?!and which line?because the error is depending to catch block.I already not used this method,and im not familiar with its params.idont know where i should to use this in my code?
maysam_p82
22-Jan-12 14:27pm
View
Also,what did you mean "don't even play with the idea of dealing with network"?:(
maysam_p82
22-Jan-12 14:17pm
View
Hi thanks for your time. First,Im in education,and im reading an ebook,this is a book example and is not my idea.But i cant understand your control.begininvokk()method.what do you mean of it. What control I should to use?and what's place of code that i should to use that?can you show me where I must use that and show me an example?
maysam_p82
26-Jan-11 3:54am
View
Thank you very much sir,you are great:**.my problem solved...
Show More