|
One of the easiest ways is using SharpZipLib[^]
But you could do it "manually" as well (with deflate streams)
|
|
|
|
|
|
hello every body,
does anybody know how to access share folder with c#,do not show the form input username and password, the os is windows mobile 5.0?
|
|
|
|
|
I would presume to say impersonation but have not tried it with Mobile.
Need custom software developed? I do C# development and consulting all over the United States.
If you don't ask questions the answers won't stand in your way.
Doing a job is like selecting a mule, you can't choose just the front half xor the back half so when you ask me to do a job don't expect me to do it half-assed.
|
|
|
|
|
|
The forums are more for helping you understand general principles. If their are specific bugs that you are noticing that you cannot fix, then we might be able to help. But most of the people of this forum will not search for any bugs that a program may/may not have. If it is a program that you would like to share and is using principles that others might find interesting, than go ahead and write an article on it and post it on the Codeproject.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
No one is going to click that link, people won't risk it for security issues.
|
|
|
|
|
does anybody know how to create guid like 3Ie7Y3GHayk on youtube ? can you show the code to create?
|
|
|
|
|
.NET provides you the Guid class.
Guid.NewGuid().ToString()
returns in this format:
96699264-91F8-4afd-AC26-CCF243B279DC
Calin
|
|
|
|
|
it's very agly string. how can i make it like in youtube.com guids
|
|
|
|
|
you may use only a part from it, or remove the dashes.
Also you may use different formatters:
.ToString("N")
.ToString("D")
.ToString("B")
.ToString("P")
Do you want to be nice and simple to guess (the algorithm), or really random and good for security?
Calin
|
|
|
|
|
i need to use it in url so i need it more nicely
|
|
|
|
|
|
and look in youtube http://www.youtube.com/watch?v=1GCqDiLX1dI. so the question was how to make like in youtube
|
|
|
|
|
you may use a few chars from a guid.
Calin
|
|
|
|
|
Just create a loop that creates random characters from 0-9 and a-z and A-Z. Then combine them for the specified length.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
|
I would imagine that 3Ie7Y3GHayk may resolve into something less than random.
Could just be base 26 or 52 integers.
45789521012586410=368I5E292I426
Need custom software developed? I do C# development and consulting all over the United States.
If you don't ask questions the answers won't stand in your way.
Doing a job is like selecting a mule, you can't choose just the front half xor the back half so when you ask me to do a job don't expect me to do it half-assed.
|
|
|
|
|
Having also numbers, I guess it's a base-62 number.
Making some calculation, 11 base-62 digits are roughly equivalent to 64 base-2 digits.
So I guess that a code like 3Ie7Y3GHayk is a base-62 encoded Int64 value.
A guid is 128 bits, so, if you want to generate this code starting from a Guid you must use half of it. I'm not sure that doing so introduces the risk of conflicting ids.
If you want something quick&dirty, you could try the following code (I used base64 that is directly provided by the framework, but keep in mind that the resulting string can containg characters like '/' or '+' that might cause problems when put in urls). Otherwise you must write your own encoding algorithm.
Guid guid = Guid.NewGuid();
byte[] guidArray = guid.ToByteArray();
byte[] halfArray = new byte[8];
Array.Copy(guidArray, halfArray, halfArray.Length);
string id = Convert.ToBase64String(halfArray).Substring(0, 11);
|
|
|
|
|
The problem with the grid is scalability from the randomness. That is why I suggested they probably aren't using a random number.
Need custom software developed? I do C# development and consulting all over the United States.
If you don't ask questions the answers won't stand in your way.
Doing a job is like selecting a mule, you can't choose just the front half xor the back half so when you ask me to do a job don't expect me to do it half-assed.
|
|
|
|
|
Yes, probably is a database index encoded in string format.
|
|
|
|
|
A guid has a specific format; I wouldn't call the code that youtube uses a "guid", even though they use it for identification.
You can use the random-function to create a random string with a given length, store it in a database, and make sure that you don't issue a double. Would that suffice for identification?
I are troll
|
|
|
|
|
Hi, is possible to get the ThreadId of the window if i know the IdProcess?
thanks. Bye Bye
|
|
|
|
|
Hi,
well...based on the processId you can get the Process , by using Process.GetProcessById(idProcess) . Then, use Threads property of the process object to get all the ProcessThread 's.
Calin
|
|
|
|
|
ok I have understood, but at the moment of lunch Process (Process.Start()), i can get the process id, but not the specific ThreadId of the window. There are many threadId when i call ProcessThread's...how can i find the ThreadId of the window?
thank you Calin.
|
|
|
|