15,884,062 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 Ali Al-Masry (Top 54 by date)
Ali Al-Masry
14-Jan-18 4:48am
View
is it available to use using statement in this way you provided in c++?
i am facing my problem in c++ code not C# one
Ali Al-Masry
19-Feb-16 9:12am
View
i found the problem is in image pixel format in paint it's System.Drawing.Imaging.PixelFormat.Format1bppIndexed
in C# its Format32bppRgb ... but when i change my image to Format1bppIndexed i get this exception message{A Graphics object cannot be created from an image that has an indexed pixel format.}
Ali Al-Masry
15-Jan-15 17:24pm
View
can you post a simple code i learn from it ?
Ali Al-Masry
15-Jan-15 17:06pm
View
i used this method to get image bytes to send it as a packet i can get it's id and length in server packet handler ...
Ali Al-Masry
15-Jan-15 15:37pm
View
any sample ?
i made this cuz i want to know which coming packet and its length ...
Ali Al-Masry
15-Jan-15 15:13pm
View
how to do that ?
Ali Al-Masry
25-Oct-14 12:33pm
View
my issue still on , i tried to use Show(this); instead of ShowForm(this); but my issue still on , then i posted the client class's cuz people here asked me for that cuz that will help them in helping me ..
Ali Al-Masry
24-Oct-14 11:38am
View
Deleted
i am already updated the question with codes ...
Ali Al-Masry
24-Oct-14 11:37am
View
Deleted
i am already updated the question with codes ...
Ali Al-Masry
23-Oct-14 20:47pm
View
Deleted
i am already updated the question with codes ...
Ali Al-Masry
23-Oct-14 20:27pm
View
i am already updated the question with codes ...
Ali Al-Masry
23-Oct-14 20:23pm
View
Deleted
i am already updated the question with codes ...
Ali Al-Masry
23-Oct-14 20:21pm
View
Deleted
i am already updated the question with codes ...
Ali Al-Masry
23-Oct-14 19:11pm
View
form do not handle sockets socket is handled by a class ( PacketHandler )
form1 just start the socket and it's handling the whole actions of the app
Ali Al-Masry
19-Apr-14 12:15pm
View
Deleted
hey bro i am not that good at sockets ,, all i need to do is edit the provided socket to make is as a client ... is it hard to this point ?
and i don't someone code for me , just help with some points .
this server socket is working like this ...
AsyncSocket ServerSocket = new AsyncSocket(9999);
ServerSocket.OnClientConnect += new Action<isocketwrapper>(AuthServer_AnnounceNewConnection);
ServerSocket.OnClientReceive += new Action<byte[], isocketwrapper="">(AuthServer_AnnounceReceive);
ServerSocket.OnClientDisconnect += new Action<isocketwrapper>(AuthServer_AnnounceDisconnection);
and as you see the socket in the thread ,,, its just listening and binding ,,, i need it to connect to the specified ip and port ... then receive and send packets same as server socket doing
Ali Al-Masry
18-Apr-14 19:10pm
View
i converted it to C# and its run successfully , but still not what i am looking for like the socket i posted above ...
Ali Al-Masry
16-Apr-14 13:39pm
View
Deleted
okay brother , dose this correct ?
this is what i have done except Datapacket Class:
private void LOGIN_BUTTON_Click(object sender, EventArgs e)
{
Network.Packets.AuthRequestPacket Req = new Network.Packets.AuthRequestPacket();
Req.Account = USERNAME_BOX.Text;
Req.Password = PASSWORD_BOX.Text;
Send(Req);
Send(Network.Packets.PacketS.SendMsg(USERNAME_BOX.Text, PASSWORD_BOX.Text));
}
private void Send(DataPacket Packet)
{
Send(Packet);
}
private void Send(Byte[] Buffer)
{
if (Buffer != null)
{
ChatSocket.Connection.Send(Buffer);
}
}
public unsafe class DataPacket
{
private byte[] _buffer;
public byte[] DataBuffer
{
get
{
return _buffer;
}
}
private byte* dataPointer
{
get
{
fixed (byte* pointer = _buffer)
return pointer;
}
}
public DataPacket(byte[] inBuffer)
{
_buffer = new byte[inBuffer.Length];
System.Buffer.BlockCopy(inBuffer, 0, _buffer, 0, inBuffer.Length);
}
public DataPacket(int packetSize, int packetID)
{
_buffer = new byte[packetSize];
WriteInt32(packetSize, 0);
WriteInt32(packetID, 4);
}
public void WriteSByte(sbyte value, int offset)
{
(*(sbyte*)(dataPointer + offset)) = value;
}
public void WriteInt16(short value, int offset)
{
(*(short*)(dataPointer + offset)) = value;
}
public void WriteInt32(int value, int offset)
{
(*(int*)(dataPointer + offset)) = value;
}
public void WriteInt64(long value, int offset)
{
(*(long*)(dataPointer + offset)) = value;
}
public void WriteByte(byte value, int offset)
{
(*(byte*)(dataPointer + offset)) = value;
}
public void WriteUInt16(ushort value, int offset)
{
(*(ushort*)(dataPointer + offset)) = value;
}
public void WriteUInt32(uint value, int offset)
{
(*(uint*)(dataPointer + offset)) = value;
}
public void WriteUInt64(ulong value, int offset)
{
(*(ulong*)(dataPointer + offset)) = value;
}
public sbyte ReadSByte(int offset)
{
return (*(sbyte*)(dataPointer + offset));
}
public short ReadInt16(int offset)
{
return (*(short*)(dataPointer + offset));
}
public int ReadInt32(int offset)
{
return (*(int*)(dataPointer + offset));
}
public long ReadInt64(int offset)
{
return (*(long*)(dataPointer + offset));
}
public byte ReadByte(int offset)
{
return (*(byte*)(dataPointer + offset));
}
public ushort ReadUInt16(int offset)
{
return (*(ushort*)(dataPointer + offset));
}
public uint ReadUInt32(int offset)
{
return (*(uint*)(dataPointer + offset));
}
public ulong ReadUInt64(int offset)
{
return (*(ulong*)(dataPointer + offset));
}
public void WriteString(string value, int offset)
{
foreach (char _char in value)
WriteByte((byte)_char, offset++);
}
public void WriteStringWithLength(string value, int offset)
{
WriteByte((byte)value.Length, offset);
offset++;
WriteString(value, offset);
}
public string ReadString(int offset, int length)
{
StringBuilder stringBuilder = new StringBuilder()
Ali Al-Masry
16-Apr-14 13:21pm
View
Deleted
dose there a server - client samples with what i am looking for ?
i need to check one to learn more .
Ali Al-Masry
16-Apr-14 10:19am
View
Deleted
Can this Code do it ?
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct LoginForm
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
public string Username;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
public string Password;
}
public static unsafe byte[] Ready()
{
IFormatter formatter = new BinaryFormatter();
LoginForm cust = new LoginForm();
byte[] data;
using (var ms = new MemoryStream())
{
formatter.Serialize(ms, cust);
data = ms.ToArray();
}
return data;
}
Ali Al-Masry
16-Apr-14 9:16am
View
Deleted
i need to learn how to create a packet Struct with this info ...
Ali Al-Masry
15-Apr-14 20:32pm
View
Deleted
still stuck at my problem , need to create packet with the info and then send it.
Ali Al-Masry
15-Apr-14 19:37pm
View
Deleted
:( need more explanation , i am new to Sockets ... , dose not there an example ? i hope yes ...
Ali Al-Masry
15-Apr-14 19:14pm
View
Deleted
i changed it to UTF8 , but same problem ... dose there another way to create and send packet structure ?
Ali Al-Masry
15-Apr-14 18:53pm
View
Deleted
i used this way : http://stackoverflow.com/a/12868432/1470043
at client and i got this : look here please : http://i.epvpimg.com/Dd5mg.png
Ali Al-Masry
15-Apr-14 18:11pm
View
Deleted
Sure i accepted it , but i have a question , is there another way to send this info instead of Send(Encoding.ASCII.GetBytes("1001:UN=user123&PW=123456")) ?
something like packet structure ?
if yes , so how to create ,fill it and send ?
Ali Al-Masry
15-Apr-14 17:36pm
View
Deleted
something like Send(Encoding.ASCII.GetBytes("1001:UN=user123&PW=123456")) //1001 is the ID ? or
Send(Encoding.ASCII.GetBytes("1001:UN=user123+" + SHA256("PW=123456"))) //1001 is the ID
?
Ali Al-Masry
15-Apr-14 17:25pm
View
Deleted
so i need to send string packet contains username ,password and packet id ?
like this : http://stackoverflow.com/questions/12326753/c-sharp-receiving-packet-in-system-sockets
Ali Al-Masry
15-Apr-14 17:13pm
View
Deleted
can`t i get an example ?
Ali Al-Masry
15-Apr-14 16:44pm
View
Deleted
i only created the server and server sockets are working well, receiving and sending , but my point now how i can make a client with login form and connect it to the server after that the server will get the usernaqme and password which was in the box's .
Ali Al-Masry
15-Apr-14 16:35pm
View
Deleted
hey brother , i have a server its working fine with two sockets ( Login Socket and Chat socket ) and i need login socket receiving login packet and then can get the username and password from the received packet from the client .
Ali Al-Masry
15-Apr-14 15:00pm
View
Deleted
the provided code is from a game , and in my case i have a server and a client with login form contains Username and password text box's how i can get the text box's values from the source for the current client
Ali Al-Masry
5-Nov-13 9:34am
View
yes its free , and i am still trying with it !!
Ali Al-Masry
5-Nov-13 8:18am
View
http://addmefast.com/free_points/facebook_likes.html
Ali Al-Masry
5-Nov-13 7:29am
View
and here is page source :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Test" />
<meta name="description" content="Get Likes, Subscribers, Followers, Views and Hits . Easy registration, 50 points at start and daily 150 bonus points for active users. Start Promotion Just Now and invite all your friends to join Example." />
<meta name="Author" content="Test" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="audience" content="all" />
<meta name="rating" content="General" />
<meta name="revisit-after" content="2 Day" />
<meta name="resource-type" content="document" />
<meta name="robots" content="All" />
<meta name="google-translate-customization" content="3f4ffc751b6f619-aaa1185795a36d3e-gc243fde537c28ad5-11"></meta>
<link rel="shortcut icon" href="/favicon.ico" />
<link href="/styles/style2.css" rel="stylesheet" type="text/css" />
<link href="/scripts/jqueryui/css/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="/scripts/msgbox/jquery.msgbox.css" />
<link rel="stylesheet" type="text/css" href="/scripts/tiptip/tipTip.css" />
<script type="text/javascript" src="/scripts/jquery.min.js"></script>
<script type="text/javascript" src="/scripts/jqueryui/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="/scripts/showLoading.js" ></script>
<script type="text/javascript" src="/scripts/msgbox/jquery.msgbox.min.js"></script>
<script type="text/javascript" src="/scripts/simple_loading/simpleload.js"></script>
<!-- <script src="/scripts/bxslider/jquery.easing.1.3.js" type="text/javascript"></script>
<script src="/scripts/bxslider/jquery.bxSlider.min.js" type="text/javascript"></script> -->
<script src="/scripts/tiptip/jquery.tipTip.minified.js" type="text/javascript"></script>
<script src="/scripts/jquery.floating_popup.min.js" type="text/javascript"></script>
<link href="https://plus.google.com/104027597398828648329" rel="publisher" />
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{parsetags: 'explicit'}
</script>
<script type="text/javascript" src="/scripts/ready.js?1383653168"></script>
<script type="text/javascript" src="/scripts/script.js?1383653168"></script>
<title>Example.com - Facebook Likes</title>
</head>
<body>
<script type="text/javascript">
(function(){
var bsa = document.createElement('script');
bsa.type = 'text/javascript';
bsa.async = true;
bsa.src = 'http://s3.buysellads.com/ac/bsa.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);
})();
</script>
<div id="dialog-overlay"></div>
<div id="dialog-ui"></div>
<div id="Div1">
</div>
<script type="text/javascript">
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) { return; }
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
} (document, 'script', 'facebook-jssdk'));
jQuery(document).ready(function(){
});
</script>
<div class="wrapper">
<div id="headerCont">
<div class="header">
<!--header header BEGIN--><div id="dialog-overlay"></div>
<div id="dialog-box">
<div class="dialog-content">
<div id="dialog-message"></div>
</div>
</div>
<div class="header_block">
<img src="/images/layout/logo1.png" alt="Add Me
Ali Al-Masry
5-Nov-13 7:25am
View
here is the code from Fire Fox Inspect Element :
<div class="page_title">
Masritna
</div><div style="width:100px; height:100px; overflow:hidden;">
<img style="width:100%; height:auto;" title="Masritna" alt="Masritna" src="/img/cook.png"></img>
</div>
<span> … </span><div class="btn3">
Click Here
</div>
Ali Al-Masry
5-Nov-13 7:17am
View
thanks brother for trying to help me now i used many ways to click any element with the tags i added ,, and its worked fine and clicked many elements as my code , but its still not clicking the one i am looking for ...
but after i close all opened new web browser tabs its open the another IE window but its disappears after 1-2 minutes also before its load page contents !!
Ali Al-Masry
4-Nov-13 15:31pm
View
so brother i tried to get more info about my issue and i found its the web page is using an script and its not located in page source , i got it using Fire Fox Inspect Element .. , and i still need a way to click this button !!
Ali Al-Masry
4-Nov-13 13:33pm
View
i have tried it many times with the code you provided .. but still didn't worked !!
here is the HTML script which contains button code in it without an ID
<span>
</span>
<div class="btn3">Click Here</div>
Ali Al-Masry
4-Nov-13 8:24am
View
i know my element is have no id and i need a way to click it , any suggestion ?
Ali Al-Masry
4-Nov-13 7:52am
View
right , show me how with a example please .. i have no idea about how to run or add java script to C# ???
Ali Al-Masry
4-Nov-13 7:51am
View
how i use this Java code while i am doing that in C# ?
Ali Al-Masry
10-Jan-13 10:03am
View
i am just increase my skills :)
Ali Al-Masry
17-Jul-12 7:30am
View
i just want to say i have a list for my app , i add songs path to it , then i play songs , so i want when i select many files and press enter on them they shall open my app and go to list , but it won`t , its just load for secs , but if it was 1 file , its go to my playlist correctly , so how i can fix this ?
Ali Al-Masry
16-Jul-12 9:08am
View
hey bro , i have created my app , and its working so prefect , only need to load multiple files to it with double click on the mp3 file.
Ali Al-Masry
16-Jul-12 8:47am
View
no problem i fixed
Object reference not set to an instance of an object
but now i wanna make it load multiple files , how i can do it ? and i can create an item for the .mp3 files to add selected mp3 files into my app but i don`t how .... any help ?
Ali Al-Masry
16-Jul-12 3:57am
View
Hello guys ? any advice ?
Ali Al-Masry
15-Jul-12 11:37am
View
i think you didn't get what i am asking for...
Ali Al-Masry
15-Jul-12 11:31am
View
so there is noway to make my audio player app play songs without Windows media player ?
Ali Al-Masry
14-Jul-12 13:24pm
View
Hello People, this dose n`t help me out.
i am trying this
http://mel-green.com/2009/04/c-set-file-type-association/
but still won`t work for me .... what steps shall i do ?
Ali Al-Masry
13-Jul-12 23:04pm
View
i am still trying to understand your example , and how it can help me ...
Ali Al-Masry
13-Jul-12 13:19pm
View
Thanks Dear , i`ll check it and i`ll reply you here then.
Ali Al-Masry
13-Jul-12 13:04pm
View
So , can you show me an example ?
Ali Al-Masry
13-Jul-12 12:48pm
View
yes , i have a trouble receiving the file, i don't know how , i just created that you can select folder to play contents , and select music file , and play music file throw url , or drag files and drop them into my app or my app playlist , but i don`t know how to receive files when use click on the music file ...
Ali Al-Masry
13-Jul-12 12:31pm
View
i mean when i click on the music file it load my app , but not adding the music into my app list , and not playing it .
Show More