|
I know your proble is solved but something I noticed in the code and wondered if it was correct.
Should new SerialPort("COM" + cont.ToString()
be new SerialPort("COM" + i.ToString() ?
Good of you to thank the guys. Not everyone does.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Yeah my mistake typing that... Thanks!
|
|
|
|
|
I want my application to programatically download a file from skydrive.live.com,
but I encountered a problem:
Microsoft uses script for file download that makes it impossible to download the file using WebClient (at least as far as I know). Could somebody help to find a workaround on how to download the file?
The microsoft's script is:
Download
var $SelfPage = new function()
{
var _download = 'http\x3a\x2f\x2f5odcbq.bay.livefilestore.com\x2fy1pi19dAInfgawlhjDTcs2sbdCJEkvL7jzsz8SVx9qA-EiQwX-ZPeg-DCt63IEoNWu7USu9uUA-j9FkUosBKqU-3Q\x2fApskaita_1.1_beta_update.exe';
var _demote = 'http\x3a\x2f\x2f5odcbq.bay.livefilestore.com\x2fy1pi19dAInfgawlhjDTcs2sbdCJEkvL7jzsz8SVx9qA-EiQwX-ZPeg-DCt63IEoNWu7USu9uUA-j9FkUosBKqU-3Q\x2fApskaita_1.1_beta_update.exe';
var _dirty = false;
this.MarkDirty = function() { _dirty = true; }
this.Download = function()
{
if (_dirty)
{
_dirty = false;
window.location = _demote;
}
else
{
window.location = _download;
}
}
}
|
|
|
|
|
Hi I don't know if anyone could help me. I'm beginner on C# programing and I have an assignment to finish and i don't know how to finish!!!
I started creating a program with a menu with options to creates a new file and read the new file. The files that I create have an boundary limits(not less than 125 and no more than 350 characters in number) and after creating and saving the file there is an option to go to main menu. This is the part that I've done. Now I have to after writting on the new file create an option to encript and save the file and when opening the file it should have another option to go back to plain text format(decrypt). The encryption should be represented as numbers grouped in pairs, and it should create alternate numbers(written twice). for some single letters ( the most common ones a,e,o,r,t), also using null characters I have to include some mechanism for introduce spaces!!! I really apreciate if anyone could help me with some suggestions,
Thanks
|
|
|
|
|
I would encrypt using built in encryption classes like Rijndael-Managed, what is it you want to do, exactly?
|
|
|
|
|
I'm on my first year of C# i've learnt all the basic but I don't know how to encrypt or decrypt any message, that is my biggest problem. Really I don't know how to convert characters to integers,
Thanks for your help
|
|
|
|
|
sofi79 wrote: don't know how to convert characters to integers
Convert.ToInt32(char)[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
sofi79 wrote: I don't know how to convert characters to integers
Probably because it's so simple:
char c = 'a' ;
int i = c ;
System.Console.WriteLine ( i ) ;
c = (char) i ;
I'd be interested in hearing more about this simple encryption process.
|
|
|
|
|
I always assumed I needed an explicit Convert calls here. Learn something new everyday.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
The Convert class is evil; don't use it.
|
|
|
|
|
Are you being serious?
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Mostly. The only member of Convert I use is ChangeType and that only in extreme circumstances.
|
|
|
|
|
What do you have against it?
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
|
I'll have to check my code at some point. I could've sworn I found places where I had to use the convert class instead of casting before.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Please do.
I've found ChangeType to be useful when I don't know the destination type at compile time and even generics won't help; it's rare. One example I have is loading a DataTable from a CSV file. Otherwise, if you know the destination type, just use it.
I ran a little test and found int.Parse to be 3% quicker than Convert.ToInt32 (ToInt32 requires an additional method invocation), which isn't much, but as it supports my position I'll consider it significant.
|
|
|
|
|
It was string to int conversion I was thinking of, although why int foo = (int)"1" fails but int foo = (int)'1'; does not is a question I'm afraid to ask.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
It gives the ASCII value (Unicode code point / whatever) of the character, which I assumed is what he wanted.
|
|
|
|
|
sofi79 wrote: and it should create alternate numbers(written twice). for some single letters ( the most common ones a,e,o,r,t)
This part is not particularly clear.
Does it mean that if your scheme decides that the letter 'a' = the number 4, then it should be written as 44 "(written twice)", or does it mean something else?
Do you understand what it means? Because if not you should go back to the assignment setter for clarification. Make sure that you fully understand the problem before posting here.
You should also make some attempt at writing some code, so that you can demonstrate to people here that you are trying and not just asking someone else to write your assignment for you.
To get you started:
Research how to get a character from a string .
Research how to convert a char to an int
Good luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
How can I Insert into Text File from Sql Table.
Is there a query like bulk insert for this work
In fact I need Invert of bulk insert ?
thanks in advanced
Hello Friends
|
|
|
|
|
You want to export an sql table? If so load it all to a table and write to a csv file, you can find examples of this anywhere on the web.
|
|
|
|
|
I have a C# program which does COM interop to a VB6 DLL via late-binding. The VB6 DLL then uses a 3rd party OCX to generate an image, the file path of which is passed back to my C# program so that it can display the image. This was all working just fine until I moved the C# program from .NET 1.1 up to .NET 2.0. Now, instead of using the program directory's version of the OCX, the COM DLL is using a version in the system32 directory which is causing problems. I can't for the life of me figure out why this is happening. I've played around with App.config files and done a few other things, but nothing is working. I don't know how to tell my C# program to use a COM OCX from a specific file location, especially when the file is not even directly referenced in the program. Again, if I compile it against .NET 1.1 it works fine, but with .NET 2.0 it breaks. Any ideas? This is really driving me crazy. Thanks in advance.
Here's an example of the late-binding code to the COM DLL:
Type myObjectType = Type.GetTypeFromProgID("MyComDLL.ClassToUse", true);
object myObject = Activator.CreateInstance(myObjectType);
myObjectType.InvokeMember("Load", BindingFlags.InvokeMethod, null, myObject, null);
|
|
|
|
|
Greetings,
Now I have my C# socket server running which accepts PowerShell input from a perl socket client running on Linux and sends reply back. I have read through and tried all the sample code on all the websites. But there seems to be a prolem with all of them (and mine). Whenever I invoke "get-acl" command from the client perl program I get this reply from the server: System.Security.AccessControl.DirectorySecurity instead of: the normal output that I see on the Powershell prompt.
But when I run the get-command at the same prompt I get the desired output.
Am I missing something here? Does this mean that getting the functionality of Powershell through this is not possbile? Has anyone tried this ?
Any help will be greatly appreciated.
Best Regards,
sk
|
|
|
|
|
A website is usually running under a restricted user-account. When you run it from the desktop, you're running under the account that you logged into.
I'm not using webservers much, at this point I'd seek out the admin and ask him. Anyway, there are more readers/posters on this thread, maybe someone can explain it better, so that I can learn from it too
I are troll
|
|
|
|
|
Thanks for the reply, hopefully someone has worked on this before. Anyone?
|
|
|
|