Skip to content

Commit

Permalink
Fixed problem with wrong url input
Browse files Browse the repository at this point in the history
  • Loading branch information
dephea committed Dec 21, 2021
1 parent 71e0b3a commit 24a3ed2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 12 deletions.
43 changes: 32 additions & 11 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,44 @@ public Form1()
//tabControl1.Click += TabControl1_Click;
}

private void TabControl1_Click(object sender, EventArgs e)
{
this.Invoke(new MethodInvoker(() =>
{
//textBox1.Text ;
}));
}


private void button5_Click(object sender, EventArgs e)
{

ChromiumWebBrowser Browser1 = tabControl1.SelectedTab.Controls[0] as ChromiumWebBrowser;
if (Browser1 != null)
Browser1.Load(textBox1.Text);



/*if (Uri.IsWellFormedUriString(textBox1.Text, UriKind.Absolute))
{
Browser1.Load(textBox1.Text);
}*/

bool checkIfDot(string s)
{
if (s.Contains("."))
{
return true;
}
return false;
}


/////////////////////////////////////////////////////////



if (Uri.IsWellFormedUriString(textBox1.Text, UriKind.RelativeOrAbsolute))
{
if (checkIfDot(textBox1.Text))
{
Browser1.Load(textBox1.Text);
}
else
{
Browser1.Load("https://www.google.com/search?q=" + textBox1.Text);
}
}

}

private void button2_Click(object sender, EventArgs e)
Expand Down
8 changes: 7 additions & 1 deletion dephBrowser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationRevision>3</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down Expand Up @@ -67,6 +67,9 @@
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>web_icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="CefSharp, Version=96.0.142.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>packages\CefSharp.Common.96.0.142\lib\net452\CefSharp.dll</HintPath>
Expand Down Expand Up @@ -137,6 +140,9 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="web_icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand Down
Binary file added web_icon.ico
Binary file not shown.

0 comments on commit 24a3ed2

Please sign in to comment.