|
You've pretty much got it...
webBrowser1.Navigate(new Uri("http://www.mygame.com/energy.php"));
EDIT: Oh, and if you're just using WinForms (As opposed to WPF), you don't even need the Uri... Just webBrowser1.Navigate("http://www.mygame.com/energy.php");
Or are you having trouble hooking the buttons up to the event? You should be able to just double-click each button in the designer, and Visual Studio will automatically create an event handler and show you where to start writing the code.
modified on Wednesday, September 30, 2009 3:33 PM
|
|
|
|
|
Thanks, it works with no errors.
I tried both of those but it wouldn't work before.
Must have been my ISP giving me troubles.
|
|
|
|
|
Hi
I am building a named pipe service using wcf using the example given in http://www.omegacoder.com/?p=101 but I am unable in Visual Studio 2008 to be able separately execute the windows form and then the console application.
Can someone explain to me how it is possible to start separately a number of projects in a solution in Visual Studio 2008? I have tried multi starts in Visual Studio, but this does not work.
Thanks
|
|
|
|
|
Two ways:
1) Start two different Visual Studios, and load a different project in each. This is easier if you have multiple monitors.
2) Start the first one normally, then in the Solution Explorer (Where it shows all of the projects and files in your solution), just right-click on the project name, pick Debug, Start New Instance.
|
|
|
|
|
Hi
I have both projects in the same project solution, and I have tried option two in your suggestion, but when I do so, Visual Studio hides solution explorer stopping me from starting the console project. How do you get round this?
Thanks
|
|
|
|
|
When you run your instance of your first application, press Ctrl + Alt + L this shortcut display Solution Explorer, now you able to see your other projects even first project, do the same as you do for first project.
Hope this work.
http://codeprojects.wordpress.com
|
|
|
|
|
Thanks, that was the answer!
|
|
|
|
|
Hi,
I have the weirdest problem.
I have a method in C# that call a function from a dll in MFC which preforms LoadLibrary() to another MFC dll.
When I'm calling this C# method from the main thread, everything is works great.
However, when I'm creating a thread (in c#) and calling the same function, the LoadLibrary in the second dll gets stuck, i.e. not returns.
And i tried also AfxLoadLibrary(), gets the same problem.
[DllImport("UpdateDB.dll")]
public static extern bool UpdateCommandsDB(String strDllPath, String strDBPath, ref string strError, bool bAppSideDB);
bRes = UpdateCommandsDB(m_sCommandDllPath, DBFilePath, ref sError, false);
extern "C" __declspec(dllexport) BOOL UpdateCommandsDB(LPCTSTR strDllPath,LPCTSTR strDBPath, CString &strError, bool bAppSideDB)
{
typedef bool(UPDATE_COMMANDS_DB_FUNC)(LPCTSTR, CString&, bool);
bool bRes;
AfxMessageBox(strDllPath);
AfxMessageBox(strDBPath);
HINSTANCE hDll = AfxLoadLibrary(strDllPath);
AfxMessageBox(hDll?_T("hDll OK"):_T("hDll NOK"));
UPDATE_COMMANDS_DB_FUNC *lpUpdateCommandsDB = (UPDATE_COMMANDS_DB_FUNC *)::GetProcAddress(hDll, "UpdateCommandsDB");
AfxMessageBox(lpUpdateCommandsDB?_T("lpUpdateCommandsDB OK"):_T("lpUpdateCommandsDB NOK"));
bRes = lpUpdateCommandsDB(strDBPath, strError, bAppSideDB);
AfxMessageBox(bRes?_T("bRes OK"):_T("bRes NOK"));
::AfxFreeLibrary(hDll);
return bRes;
}
Please Help
|
|
|
|
|
I have a problem regarding multiple log files. In my project i have a GeneralLog (singleton instance) that is configured from the app.config of the application.
<log4net>
<!-- The DebugFileAppender writes all messages to a log file-->
<appender name="GeneralAppender" type="log4net.Appender.FileAppender">
<!-->the file where to write the events<-->
<file value="GeneralLog.dat" />
<!-->the lowest level a message must reach in order to get written in the log file<-->
<threshold value="WARN" />
<!-->a value indicating that every message is appended to the log file<-->
<appendToFile value="true" />
<maximumFileSize value="100KB"/>
<rollingStyle value="Size"/>
<!-->the message layout<-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="[%d] - %m%n" />
</layout>
</appender>
<root>
<!-- add other appenders here and the log messages will be sent to every listed appender -->
<appender-ref ref="GeneralAppender" />
</root>
</log4net>
This works. During the execution I create alot more (dynamically) log files from appenders defined like this:
FileAppender generalLogAppender = new FileAppender();
generalLogAppender.Name = generalLogFileName;
generalLogAppender.File = "Log+"+ fileName + ".dat";
generalLogAppender.AppendToFile = true;
generalLogAppender.Threshold = Level.Warn;
PatternLayout layout2 = new PatternLayout();
layout2.ConversionPattern = "[%d] - %m%n";
layout2.ActivateOptions();
generalLogAppender.ActivateOptions();
BasicConfigurator.Configure(generalLogAppender);
The files are created, but nothing is written in them, only in the GeneralLog. I am really confused by this. I checked the net and of course CodeProject and found only static examples of logs, never a mixed case.
I am fighting against the Universe...
Reference-Rick Cook
|
|
|
|
|
Solved.
BasicConfigurator.Configure(generalLogAppender);
had to be called after the appender was attached to the logger.
I am fighting against the Universe...
Reference-Rick Cook
|
|
|
|
|
Hello,
i add a Ado .net data entity(evpml), but i have an exception : The underlying provider failed on Open.
private static evpml GetEntities()
{
return new evpml();
}
public static List<users> GetUsersDC()
{
return GetEntities().users.ToList<users>();
}
Thank you verry mutch.
|
|
|
|
|
The exception looks like the database connection failed to connect to the database. I would start by verifying the connection string is correct.
|
|
|
|
|
yes, the connection is correct, i make this with the visual componement, i add the tables. please help me, thank you verry mutch.
|
|
|
|
|
Have you tried to debug and look at the exception an possibly inner exception?
only two letters away from being an asset
|
|
|
|
|
there are two ways out:
1. Modify the connection string to pass username/password credentials, instead of using a trusted connection.
2. Grant access to ‘NT AUTHORITY\NETWORK SERVICE’ to your database.
|
|
|
|
|
Dear All,
I have Adobe Reader Control in my Win Form. I am loading pdf files from Remote Server into this control.
Well, among Thousand of Files there are about 10 Files which can not be opened by Adobe Reader Control.
I am using Adobe Reader 8.0
For Test only, I copied those files from remote server to Drive C of my computer.
Then I made an application to show these PDF files.
Every thing worked correctly from my drive C.
let me mentioned that among thousands of files in remote server i can not only show these 10 files in adobe control other files are shown accurately.
Even I Tested WebBrowser Control to show these files from remote server but failure.
Let me make sure that file exists in remote sever. I am asking why these 10 files can not be shown from remote server? while i can browse these files using Adobe Reader 8.0 and the same i can browse them when i copy them to my c drive.
for sample code
string filePath=statee.ToString();
webVr.LoadFile(filePath);
webVr is the Adobe Control.
any ideas?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Hello All..
i have a TreeView called "tvwProject" which in the frmLoad function i have the following code:
//tvwProject.SelectedNode = tvwProject.TopNode;
meaning that i don't want any node to be selected in the loading of the frm.
the event's flow continues to the Enter function & automatically to AfterSelect
in the Enter event -> tvwProject.SelectedNode == null
BUT in AfterSelect event -> tvwProject.SelectedNode = first node in treeView
how can i control the selected node ??
how can i see the event flow in my program ??
thank's
Eyal
|
|
|
|
|
Try this link.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
Thanks
Md. Marufuzzaman
|
|
|
|
|
Hi All,
I have created one Windows Applcation and its Setup. While installing the appliaton with Setup.exe, I create one registry entry with below code.
Step 1 : regKey = Microsoft.Win32.Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\MyKey");
Immediately after this, I read this value with below code.
Step 2 : regRead = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\MyKey", true);
Then when I run the application I read the registry with below code, it is same as Step 2.
Step 2 : regRead = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\MyKey", true);
All works fine..
But when I installed this application on 64-bit Vista Business machine it creates problem.
Vista created Wow6432Node for registry entries of 32-bit application. It is a transparent process.
For, Step 1 it has created MyKey under HKLM\SOFTWARE\Wow6432Node\Microsoft.
For, Step 2 it has fetched value of MyKey from HKLM\SOFTWARE\Wow6432Node\Microsoft.
For, Step 3 it does not find the registry entry and return null.
Code for opening sub key in Step 2 and 3 is same..
Please advise.
Regards,
-SIFAR.
|
|
|
|
|
Hi,
looks like the installer works on 32-bit environment (Wow6432Node, this is absolutly transparent for the installer). The application works on 64-bit and looks up the key like on a 32-bit mashine without Wow6432Node.
is there a way to compile a installer for 64-bit sys? I'm not adept in installers.
bye
|
|
|
|
|
Hello Everyone,
I have retrieved data in Grid View from wizard.. I have modified 2 fields in Grid View
I need to update the same using update command using table-adapter.
Can anyone help me how to use update command...
Thanks in advance..
|
|
|
|
|
This question has been asked and answered so many times in these forums that it is almost impossible to count.
Use the search box at the top of the page (or use Google) and search on something like tableadapter update.
You will get loads of hits and it is much faster than waiting for an answer from here.
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 let the user insert a new values into a combobox inside of datagridview?
I have datagrigview with columns.
One of them contain 5 values that are common and there is a lot of values that the user can insert them by him self.
The problem is that if choose Combobox in the datagrid then the user can only choose the values that been insert to item list of the combobox and if i choose textbox then the user can't pick default values by click, just by writing the full name.
What can i do if i want the user to possibility to choose or to write new values?
|
|
|
|
|
I wrote a Web application by ASP.NET and C#. I need to change date of my server behind about 1 year ago and after that changing date came back. For example, time is 30/09/2009 and when the program runs, time should be 30/09/2008 and after 3sec time comes back 30/09/2009.
I wrote this rule by ASP.NET and C# and that web application work correctly, but for 5 days, that code can't change date of server, although web application worked correctly and could change date by below codes.
Also these codes work and can change date of server when those are written as WIN application and don't return any error, and those are written as WEB application and run in Visual Studio 2008 don't return any error and works correctly, but when those codes are written as WEB application and run in ISS can't change date of server and return "error: 1314", so I be confused!!!
I will be very glad if somebody helps me.
Thank you very much.
<pre> [DllImport("kernel32.dll", SetLastError = true)]
public static extern int SetLocalTime(ref SystemTime lpSystemTime);
[DllImport("kernel32.dll", SetLastError = true)]
private static extern uint GetLastError();
public struct SystemTime
{
public short wYear;
public short wMonth;
public short wDayOfWeek;
public short wDay;
public short wHour;
public short wMinute;
public short wSecond;
public short wMilliseconds;
}
private void ChangeDate()
{
SystemTime systNew = new SystemTime();
systNew.wDay = (short)dateTime.Day;
systNew.wMonth = (short)dateTime.Month;
systNew.wYear = (short)2008;
systNew.wHour = (short)dateTime.Hour;
systNew.wMinute = (short)dateTime.Minute;
systNew.wSecond = (short)dateTime.Second;
SetLocalTime(ref systNew);
uint lastErrCode = GetLastError();
}</pre>
|
|
|
|
|
Hi,
FYI: Error 1314 = A required privilege is not held by the client.
FWIW: As a user of some systems, I would hope other users can't change the system date.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|