|
|
|
Hello. I want to open a new Browser window, for example Internet Explorer or Firefox, depending of what is your default navegator.
One way will be this:
System.Diagnostics.Process.Start("http://www.google.com");
But the problem of that is that if I have a Internet explorer window open, and I execute the line, it'll be open the google page in that explorer. I want to open the google page in a new web browser.
An other option is this:
System.Diagnostics.Process.Start("IExplore.exe", strLink);
But I only open with IExplorer
Any ideas ?
Thanks a lot.
|
|
|
|
|
Process p = new Process();<br />
p.StartInfo.FileName = "iexplore.exe";<br />
p.StartInfo.Arguments = "http://www.ryanfarley.com/";<br />
p.Start();
|
|
|
|
|
Hello albCode. The problem is that I want to open the default web broswer of the client.
Thanks a lot.
|
|
|
|
|
Hi, I need help with a Regular Expression for an integer between 0 and 2,147,483,647... I need this to validate than a positive integer in a int32.
Thanks, I would appreciate any help I can get..
|
|
|
|
|
Are you sure a Regex is the right tool for this? You're better off using this:
string number = "1235456";
int num = 0;
if(Int32.TryParse(number, num) && num >= 0)
{
}
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Greeeg wrote: Are you sure a Regex is the right tool for this? You're better off using this:
I agree, rather not regex tha interger.
|
|
|
|
|
Be sure to use Int32.TryParse with NumberStyles.AllowThousands:
Int32.TryParse(number, System.Globalization.NumberStyles.AllowThousands, System.Globalization.NumberFormatInfo.CurrentInfo, out num);
|
|
|
|
|
|
When the default assembly(xxxx.resx) is created in a localized project, how does one extract the file to send out for translation and how do you import it back into the project after the translation?
|
|
|
|
|
Hi,
I'm not absolut sure, but if you use .NET2.0 there should be an editor where you can edit the ressource file's and the GUI. But I havent worked with it yet (just having a quick look).
I wrote my own ressource file parser that creates an excel file wich I can send to our customers.
Actually i cant send this parser to you because its company restricted (sorry) and offcourse a bit buggy (lol). But its not that hard to do on your own. You simply need to watch out for Attributes that ends with ".Text". I saved the control text along with the control name to the excel file so that I am able to write the modified excel table back to the ressource.
Thats all... a simple recompile and the software is localized (of course you need to check the GUI *hehe*).
Good luck,
Snow
|
|
|
|
|
If you are using professionel translation just send the compiled EXE file, and you should get satallite DLL's back. Can't say it for sure though as we wrote our own translation tools (the commercial available solutions sucked so big time when you ran them at enterprise level), but I would be surprised if they can't handle it. Talk to a few translation vendors to find out what they support.
The editing feature built into Visusal Studio is just for small hobby projects where you manually maintain a language or two - it can't be used for anything serious. But if you only need a language or two translated by someone you know then send them the VS project and let them use VS to translate.
|
|
|
|
|
Please I want to know how to register dll com component in C# using windows API not shell command.
Please I need it very urgent.
-- modified at 11:55 Monday 15th May, 2006
|
|
|
|
|
Umm, AFAIK, you can do this only using the regsvr32 executable. Thus, you will have to pass it a shell command. What's wrong with that? You can still use C# code to execute the shell command:
Process proc = new Process();
proc.StartInfo.FileName = "regsvr32";
proc.StartInfo.Arguments = "myComDll.dll";
proc.Start();
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Thank you for your help
I know that I can still use C# code by using shell commands. But actually I am doing it for someone that asked me to do it using windows API without using the shell commands!
So please if you/anyone have any ideas please send it.
Thank you
|
|
|
|
|
As far as I know, COM dlls are registered on the system using regsvr32. I've never seen an API that registers a COM dll manually. That said, I'm no COM expert.
I mean, dll registration is simply adding the dll to the system and making it known throughout the registry; all things that can be done with the Win32 API of course. In the end though, I see no reason not to simply use the regsvr32 executable; that's what it's there for.
I suppose you might want to try the COM forum instead, as this more pertains to COM than C#.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
There is no one API call that does this. You have to open the component file, parse and get the ALL of the GUIDs and names for each object, method, property, ...whatnot.... Then write each GUID and name to the registry in the appropriate locations.
You can try to implement something like this, probably taking you 6 months of work as you figure out the internals of COM and the API's involved. Or, do it the easy way, and shell out to RegSrv32, and have it done in 5 minutes.
Which option do you think would be more cost effective?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I'm sending data from my server app to my client app via TCP socketing...
The data I send is the content of a file, which I know is not larger than 8k.
Thus I fit the entire file content into one pack.
This is my function which handles incomming data, and writes it to the file(Buffer and Pack are classes written by me):
private void myDataArrivalFunction(Buffer bf)
{
while (bf.PacksCount > 0)
{
Pack p = bf.GetNextPack();
string fileName = "blablabla the path to my file";
File.WriteAllBytes(fileName, p.Data);
Application.DoEvents();
try
{
File.Delete(fileName);
}
catch (Exception ex)
{
}
}
}
Once the file has been opened once, File.Delete() fails, saying the file is being used by another process.
I originally used a FileStream object and tried to gain some additional access rights and stuff, but nothing worked.
Even after closing the FileStream object I received the same exception.
Any ideas?
-- modified at 11:16 Monday 15th May, 2006
|
|
|
|
|
Did you close the file after writing to it?
|
|
|
|
|
Yes, I did...
shyagam wrote: Even after closing the FileStream object I received the same exception.
|
|
|
|
|
Could you please post the whole code for the method? The method as it is posted will work fine. My guess is there's something in the "analyze the new file" part that is opening the stream again.
Otherwise, if you're using multiple threads, perhaps another thread is calling this same method or accessing the file somewhere else?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Judah Himango wrote: Otherwise, if you're using multiple threads, perhaps another thread is calling this same method or accessing the file somewhere else?
Indeed, I am using multiple threads.
Though the method IS accessed by multiple threads at the same time, every thread has its own fileName...
Thus, there is no chance (I hope I'm not wrong ) that one thread is accessing another's file.
Taking this a bit further, I've got an array of sockets.
All sockets call this method.
The files I'm sending are jpg files...
I have a class with a Bitmap field, and an array of objects of this class.
On "Analyze the new file" part, I have a call to a method located inside this class, which loads the file into the Bitmap object.
I obtain the index of the socket received the data, and use it as the index in the other array, to load the jpg file into the appropriate object.
public void FromFile(string fileName)
{
bmp.FromFile(fileName);
}
Before posting my original message, I've guessed this might be the problem.
So I've attempted the following:
public void FromFile(string fileName)
{
Bitmap tmp = (Bitmap)Bitmap.FromFile(fileName);
bmp = tmp.Clone();
tmp.Dispose();
tmp = null;
GC.Collect();
}
Didn't work either...
Is it possible that loading the jpg file into the Bitmap object causes a lock of the file?
-- modified at 13:30 Monday 15th May, 2006
|
|
|
|
|
I'm not sure if this helps, but:
Open the file using a stream, load the bitmap from the stream and close the stream.
---
b { font-weight: normal; }
|
|
|
|
|
Damn! I can't beleive it!
It worked!
public void FromFile(string FileName)
{
Stream s = new FileStream(FileName, FileMode.Open, FileAccess.Read);
content = (Bitmap)Bitmap.FromStream(s);
s.Close();
s = null;
GC.Collect();
} Simple, yet deadly...
Thanks Guffa.
Shy.
|
|
|
|