|
Is there any built in function to reverse a string in c# if yes what is that?
|
|
|
|
|
What DR. GUI .NET (link[^])says about StrReverse equivalent: "None—use StringBuilder and loop to reverse by swapping characters in place."
Dunno about .NET 2.0 however.
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
No, there isn't.
You can convert the string to a character array, reverse the array, and then create a string from the array.
---
b { font-weight: normal; }
|
|
|
|
|
|
how are you dudes ?
How can i connect to online user using dial up connection on the internet by knowing his ip address ?
i mean if i have the ip address of one user on the internet but he uses dial up connection or DSL how can i connect to his pc using c#?
even if he is out of my ISP ( Internet Service Provider) on dial connection and if he is connected using DSL he is behind his router and his network configuration
i used this code
<br />
IpHostEntry myhost = Dns.Resolve(his ip address as string);<br />
IpAddress ip = myhost.addresslist[0];<br />
string[] aliases = myhost.aliases;<br />
ipendpoint remoteendpoint = new ipendpoint(ip,(Int32)10000);<br />
tcpclient myclient = new tcpclient();<br />
myclient.connect(remoteendpoint);<br />
is this code can connect to the users using dsl or dial up connection remotely ?
cause may be this code will not work cause when the user connect using dial up connection he takes virtual ip address from his ISP ( Internet Service Provider ) and if he is connected using DSL he is behind his router and network configuration.
The question is i didn't test this code with someone online on the internet but i want to know is this code can do the real work by connecting to the user at the specified ip address or no ?
please Help me with this
Please Reply to me please.
Thanks alot
Miss With The Best And Die Like The Rest
|
|
|
|
|
You can connect to his machine IF AND ONLY IF his router and/or firewall is setup to let you connect to his machine. If not, he'll have to modify his router configuration.
The type of connection he's using doesn't make any difference what-so-ever. So long as he's connected to the Internet and using a valid IP and his router is configured to let you in, you can connect to his machine.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can I detect mouse clicks outside of the application and then read the coordinates? I'm trying to create an application which pops up menu when clicked right edge of screen with the right mouse button.
|
|
|
|
|
zh_ wrote:
How can I detect mouse clicks outside of the application
To Detecte Mouse or Keyboard event outside your Application you need to use Hooking ther are many articles
at Codeproject about hooking one of them
Global System Hooks in .NET
[^]and look at HOW TO: Set a Windows Hook in Visual C# .NET[^]
if you want to get mouse position you can use
Cursor.Position
MCAD
-- modified at 9:47 Sunday 28th August, 2005
|
|
|
|
|
Hello.
While running a C# code I'm running a C method from a pre-compiled dll (LZO decompressor)
On some calls to this method I recive a memory exceptions assumed to be related with the garbge collector. Even using fixed memory pointers in an "unsafe" code section didn't solve the problem (very strange).
while(...){
try{
unsafe{
.
.
.
fixed(byte* Psrc = src, Pdst = dst, Pwrkmem = this._workMemory){
lzo1x_decompress(Psrc, SourceSize, Pdst, &outlen, Pwrkmem);
}
.
.
.
}
}
catch{
.
.
.
}
}
Calling the GC with GC.Collect() before the calling C function gave *less* memory excepetions but didn't solve the problem.
I decided to try to shut down memory managment while executing the C function.
Anybody know how to pause & resume the garbage collector ?
Anybody know how to solve this problem ?
The Exception beening thrown is "Object reference not set to an instance of an object." I assume this is bacause the garbage collector has moved one of the variables.
Gilad.
|
|
|
|
|
giladkapel wrote:
The Exception beening thrown is "Object reference not set to an instance of an object." I assume this is bacause the garbage collector has moved one of the variables.
Doubtful, if it had a reference and the garbage collector moved it then the reference will refer to the new location.
giladkapel wrote:
fixed(byte* Psrc = src, Pdst = dst, Pwrkmem = this._workMemory)
Since you don't show the defintion of the src, dst and _workMemory I cannot tell what they are. However, normally the fixed statement is used like this:
fixed(byte* pSomeObject = &someObject) which also uses the & (address of) operator.
So, what exactly is no longer referenced that was once referenced?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
-- modified at 10:59 Sunday 28th August, 2005
|
|
|
|
|
src, dst & this._workMemory are all byte[] type arrays.
I have no clue what is no longer referanced as I inly have the dll, no source.
Gilad.
|
|
|
|
|
The GC *never* set anything but a WeakReference to null. The problem you describe is caused by trying to access a member of a variable that is null. Put an Debug.Assert(var != null) before the line that's throwing the exception and you'll understand what I mean.
I see dead pixels
Yes, even I am blogging now!
|
|
|
|
|
hi
im doing parameterized query whereby the user has to enter id and password. im using access database to store my data and using visual studio .net 2003 to build my app. if the id n password match, data is retrieved. i need help to ensure that password typed is of the exact case as stored in database. that means, if password in database is hELLo23 the user cannot access if he types hello23. how do i do that?
second problem is how can i make it such that user types in password and the password appears like this ********?
finally, how do i let password in database appear in encrypted text so that it is impossible to see the password in text format? i read about hash... do i use that? can i have more details?
thanks! =)
|
|
|
|
|
nidhelp wrote:
im doing parameterized query whereby the user has to enter id and password. im using access database to store my data and using visual studio .net 2003 to build my app. if the id n password match, data is retrieved. i need help to ensure that password typed is of the exact case as stored in database. that means, if password in database is hELLo23 the user cannot access if he types hello23. how do i do that?
Use StrComp Function this function can be configired to make Binary Comparison
For example
<br />
Select * From Customers Where StrComp('ContactName','anyNamE',0)=0<br />
The Third Parameter =0 which tell the function use binary Coparison (Case Sensitive) and we compare the return value
From function with zero which mean the two string are equal
To learn more about the function parameters and return value look at StrComp Function[^]
nidhelp wrote:
second problem is how can i make it such that user types in password and the password appears like this ********?
TextBox have Propert Called PasswordChar Set it to The Character you want instead of plain text in your case set
It to *
MCAD
-- modified at 9:16 Sunday 28th August, 2005
|
|
|
|
|
hi
i got error when i tried StrComp Function --> Select * From Customers Where StrComp('ContactName','anyNamE',0)=0. it says something about YourPassword is not in Parameter collection. indeed it's not there. this line is what i wrote in OKbutton click event: oleDbDataAdapter2.SelectCommand.Parameters["YourPassword"].Value = textBox2.Text;
well, i tried to remove that line, but what i typed in password textbox did not successfully sense correct password (eg. hELLo23) and retrieve data from Access and display. It's supposed to sense hELLo23 from hello23 or HELLO23 or any other inputs that are different from that (hELLO23) in my database.
i also tried to do this --> Select * From Customers Where StrComp('ContactName','anyNamE',2)=2 as msdn says write '2' for Microsoft Access only. Performs a comparison based on information in your database. but it seems no difference as writing '0'.
loading of data is fine if i do this --> oleDbDataAdapter2.SelectCommand.Parameters["ID_Number_"].Value = textBox1.Text;
oleDbDataAdapter2.SelectCommand.Parameters["YourPassword"].Value = textBox2.Text;
dataSet41.Clear();
oleDbDataAdapter2.Fill(dataSet41);
if(this.BindingContext[dataSet41, "Table1"].Count == 0)
{
MessageBox.Show("Error Occured");
textBox1.Focus();
}
the only problem is that it's not case-sensitive in password textbox and it shows data even though password case is not the same as db.
i just want to ensure that for password any wrong case will not let user have access to get the data.
thanks a lot!
|
|
|
|
|
another problem is i have these 3 columns AdministratorPwd, YourPassword and userID as part of my Access db table. typing in the 2 textboxes (AdministratorPwd and CustomerID) OR (YourPassword and CustomerID) is supposed to query the db for the same piece of data, that is, i should be able to get data belonging to this particular Customer whether i type (AdministratorPwd and CustomerID) OR (YourPassword and CustomerID).
For eg, i want to view info regarding customerA so i type AdministratorPwd and CustomerID --> admin and CustomerA or i can also type YourPassword and CustomerID --> workerA and CustomerA.
however, when i use querybuilder to write ........ WHERE AdministratorPwd=? OR YourPassword=? AND CustomerID=? I get errors--> Password is not in parameter collection and also i'll be getting CustomerB or some other customer's info from db.
|
|
|
|
|
nidhelp wrote:
finally, how do i let password in database appear in encrypted text so that it is impossible to see the password in text format? i read about hash... do i use that? can i have more details?
you can store password in database in few ways
1-Plain text
but this unsecure
2-Encrypt password and store encrypted text in database
This way better then Store Plain text but the problem with this is you have to store private or secret key which you will use it to encrypt and decrypt the password So if any one gain access to this key it will be easy to decrypt your password
3-One-Way Hash password
this the best way because you dont have to store any private key you hash the password and store it in the database when the user provide his passwod you hash it and compare it with the one stored in the database
For example how to do it you can google it like
One-Way Hashing[^]
MCAD
-- modified at 20:30 Monday 29th August, 2005
|
|
|
|
|
Probably an MD5 or SHA1 or 2 with salt is the best.
Matt Gerrans
|
|
|
|
|
Adding a new element to my solution i can choose by much stuff, in which component and windows form.
Both make a form, but what is the differences if i choose one or other?
|
|
|
|
|
i don't think, that a component "makes" a form
a windows form is a container for different windows controls, whereas a component is a non visual component. for example a sqlConnection or a Timer is a component. components appear during design time on a seperate panel at the bottom of your windows forms designer. while execution components aren't visible - but they work invisible in the background of your application...
|
|
|
|
|
Hi
I have a C# application that uses Crystal Reports 10. I developed a setup project with Visual Studio.
For the Crystal Reports, I added the CrystalReports merge module to the setup.
When installing version 1.0 of my softare, everything works fine. The appliation and the Crystal Reports are installed on the target machine.
Now I have to deploy version 1.1 of the application. When I first remove version 1.0 and then install version 1.1 still everything is fine.
But when I don't uninstall 1.0 first and install version 1.1, the new version of my application is installed, but the Crystal Report dll's are removed from the system!
Any idea why it removes the Crystal dll's when I update?
thanx
Claudio
Claudio's Website
|
|
|
|
|
Hi all,
i wanna know way to store every row in a datagridview into array list
also i wanna know way to sort data by specific column in datagridview
watting u
don't forget me
|
|
|
|
|
How to get address of variable in C# not use unsafe code.
le van giang
|
|
|
|
|
simply you cannot.
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is obliterating us.
|
|
|
|
|
You can't. As there is nothing you could use that address for in safe mode, there is no reason to have the functionality to get it in safe mode.
How do you plan to use it?
---
b { font-weight: normal; }
-- modified at 13:29 Sunday 28th August, 2005
Changed unsafe to safe in my post, as that was what I meant.
|
|
|
|