Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
shokerm committed May 12, 2022
1 parent 1f4b62a commit 22c062e
Show file tree
Hide file tree
Showing 13 changed files with 5,177 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ConsoleApp1/ConsoleApp1.csproj
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
64 changes: 64 additions & 0 deletions ConsoleApp1/Program.cs
@@ -0,0 +1,64 @@
using System;
using System.Diagnostics;
namespace WhatsappSender
{
internal class Program
{
static void Main(string[] args)
{

Console.WriteLine("enter number phone");
string phoneNumber = Console.ReadLine();

if (phoneNumber.Contains('-') && phoneNumber.Substring(0, 1) == "0")
{
for (int i = 0; i < phoneNumber.Count(); i++)
{
if(phoneNumber.Contains('-'))
{
int y = phoneNumber.IndexOf('-');
phoneNumber = phoneNumber.Remove(y, 1);
}

}

phoneNumber = "+972" + phoneNumber.Substring(1, 9);
Console.WriteLine(phoneNumber);

}
else if (!phoneNumber.Contains('-') && phoneNumber.Substring(0, 2) == "05")
{
phoneNumber = "+972" + phoneNumber.Substring(1, 9);
Console.WriteLine(phoneNumber);

}

//if (phoneNumber.Substring(3, 1) == "-" && phoneNumber.Substring(0, 1) == "0")
//{
// phoneNumber = phoneNumber.Remove(3, 1);
// phoneNumber = "+972" + phoneNumber.Substring(1, 9);
// Console.WriteLine(phoneNumber);

//}
//else if (!phoneNumber.Contains('-') && phoneNumber.Substring(0,2) == "05")
//{
// phoneNumber = "+972" + phoneNumber.Substring(1, 9);
// Console.WriteLine(phoneNumber);

//}




//if (phoneNumber?.Substring(0, 1) == "0")
//{
// phoneNumber = "+972" + phoneNumber.Substring(1, 9);
// var ps = new ProcessStartInfo($"https://web.whatsapp.com/send?phone= + {phoneNumber}");
// ps.UseShellExecute = true;
// Process.Start(ps);


//}
}
}
}
25 changes: 25 additions & 0 deletions WhatsappSender.sln
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32210.238
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WhatsappSender", "WhatsappSender\WhatsappSender.csproj", "{2F8A5A91-445F-4CE6-A570-11768FE20778}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2F8A5A91-445F-4CE6-A570-11768FE20778}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F8A5A91-445F-4CE6-A570-11768FE20778}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F8A5A91-445F-4CE6-A570-11768FE20778}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F8A5A91-445F-4CE6-A570-11768FE20778}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E53DA417-C102-4411-A815-05B10FE7193B}
EndGlobalSection
EndGlobal
146 changes: 146 additions & 0 deletions WhatsappSender/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 102 additions & 0 deletions WhatsappSender/Form1.cs
@@ -0,0 +1,102 @@
using System.Diagnostics;
namespace WhatsappSender
{
public partial class Form1 : Form
{
public string phoneNumber;
public Form1()
{
InitializeComponent();
}

private void numberTxb_TextChanged(object sender, EventArgs e)
{
phoneNumber = numberTxb.Text;
}

private void browserBtn_Click(object sender, EventArgs e)
{
try
{
if (phoneNumber.Contains('-') && phoneNumber.Substring(0, 1) == "0")
{
for (int i = 0; i < phoneNumber.Count(); i++)
{
if (phoneNumber.Contains('-'))
{
int y = phoneNumber.IndexOf('-');
phoneNumber = phoneNumber.Remove(y, 1);
}

}

phoneNumber = "+972" + phoneNumber.Substring(1, 9);
Console.WriteLine(phoneNumber);

}
else if (!phoneNumber.Contains('-') && phoneNumber.Substring(0, 2) == "05")
{
phoneNumber = "+972" + phoneNumber.Substring(1, 9);
Console.WriteLine(phoneNumber);

}

var ps = new ProcessStartInfo($"https://web.whatsapp.com/send?phone= + {phoneNumber}");
ps.UseShellExecute = true;
Process.Start(ps);
numberTxb.Text = "";


}
catch (Exception)
{


}
}

private void appBtn_Click(object sender, EventArgs e)
{
try
{
if (phoneNumber.Contains('-') && phoneNumber.Substring(0, 1) == "0")
{
for (int i = 0; i < phoneNumber.Count(); i++)
{
if (phoneNumber.Contains('-'))
{
int y = phoneNumber.IndexOf('-');
phoneNumber = phoneNumber.Remove(y, 1);
}

}

phoneNumber = "972" + phoneNumber.Substring(1, 9);


}
else if (!phoneNumber.Contains('-') && phoneNumber.Substring(0, 2) == "05")
{
phoneNumber = "972" + phoneNumber.Substring(1, 9);


}


var ps1 = new ProcessStartInfo($"https://api.whatsapp.com/send?phone={phoneNumber}");
ps1.UseShellExecute = true;
Process.Start(ps1);
numberTxb.Text = "";


}
catch (Exception)
{


}
}


}
}

0 comments on commit 22c062e

Please sign in to comment.