Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
sinhol committed Nov 15, 2018
0 parents commit b5358f9
Show file tree
Hide file tree
Showing 25 changed files with 2,029 additions and 0 deletions.
129 changes: 129 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
[Bb]in/
[Oo]bj/

# Logs
Logs/

# Generated files
project.lock.json
.vs/

# Nuget packages
nupkg/*.nupkg
nupkg/push.bat

# Profile images
ProfileImages/

# mstest test results
TestResults

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug/
[Rr]elease/
x64/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.log
*.vspscc
*.vssscc
.builds

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Publish Web Output
*.Publish.xml

# NuGet Packages Directory
packages

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
[Bb]in
[Oo]bj
sql
TestResults
[Tt]est[Rr]esult*
*.Cache
ClientBin
[Ss]tyle[Cc]op.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
src/.vs/config/applicationhost.config

# GitLink
!GitLink.exe
!nuget.exe
!SQLite.Interop.dll
/tools
25 changes: 25 additions & 0 deletions Wechat.Demo.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wechat.Demo", "Wechat.Demo\Wechat.Demo.csproj", "{471426E0-5D56-4373-955C-30662C559BA3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{471426E0-5D56-4373-955C-30662C559BA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{471426E0-5D56-4373-955C-30662C559BA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{471426E0-5D56-4373-955C-30662C559BA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{471426E0-5D56-4373-955C-30662C559BA3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8467CDED-F7B6-4744-81A4-541C14280C7D}
EndGlobalSection
EndGlobal
9 changes: 9 additions & 0 deletions Wechat.Demo/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="Wechat.Demos.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Wechat.Demo"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
16 changes: 16 additions & 0 deletions Wechat.Demo/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace Wechat.Demo
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
29 changes: 29 additions & 0 deletions Wechat.Demo/Config/ConfigHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace Wechat.Demo.Config
{
public class ConfigHelper
{
static readonly IniFile IniFile = new IniFile(AppDomain.CurrentDomain.BaseDirectory + "config.ini");

/// <summary>
/// 写入
/// </summary>
public static void Set(string section, string key, string val)
{
IniFile.WriteValue(section, key, val);
}

/// <summary>
/// 读取
/// </summary>
public static string Get(string section, string key)
{
return IniFile.ReadValue(section, key);
}
}
}
48 changes: 48 additions & 0 deletions Wechat.Demo/Config/IniFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace Wechat.Demo.Config
{
public class IniFile
{
//文件INI名称
private readonly string _path;

[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);

public IniFile(string path)
{
this._path = path;
}

/// <summary>
/// 写入INI文件
/// </summary>
/// <param name="section">配置节</param>
/// <param name="key">键名</param>
/// <param name="value">键值</param>
public void WriteValue(string section, string key, string value)
{
WritePrivateProfileString(section, key, value, this._path);
}

/// <summary>
/// 读取制定INI文件键值
/// </summary>
/// <param name="section">配置节</param>
/// <param name="key">键名</param>
/// <returns></returns>
public string ReadValue(string section, string key)
{
StringBuilder temp = new StringBuilder(255);
int i = GetPrivateProfileString(section, key, "", temp, 255, this._path);
return temp.ToString();
}
}
}
27 changes: 27 additions & 0 deletions Wechat.Demo/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Window x:Class="Wechat.Demo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Wechat.Demo"
mc:Ignorable="d"
Title="DEMO" Height="370" Width="525" ResizeMode="NoResize">
<Grid>
<Border BorderThickness="1" BorderBrush="#FF000000" VerticalAlignment="Top" Height="204" Width="204" Margin="10,60,284.6,0">
<Image Name="ImgQrLogin" HorizontalAlignment="Left" VerticalAlignment="Top" Height="200" Margin="1.2,1.2,0,0" Width="200"/>
</Border>
<Button Name="BtnLogin" Content="登录微信" HorizontalAlignment="Left" Margin="237,234,0,0" VerticalAlignment="Top" Width="264" Height="30" Click="Button_Click"/>
<Label Content="62数据:" HorizontalAlignment="Left" Margin="228,119,0,0" VerticalAlignment="Top" RenderTransformOrigin="2.252,0.547"/>
<CheckBox Name="Ckb62Data" Content="使用62登录" HorizontalAlignment="Left" Margin="237,206,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.321,2.181"/>
<TextBox Name="Txt62Data" HorizontalAlignment="Left" Height="48" Margin="237,145,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="264"/>
<Label Content="帐户:" HorizontalAlignment="Left" Margin="228,57,0,0" VerticalAlignment="Top" RenderTransformOrigin="5.052,-6.116"/>
<Label Content="密码:" HorizontalAlignment="Left" Margin="228,88,0,0" VerticalAlignment="Top"/>
<TextBox Name="TxtUserName" HorizontalAlignment="Left" Height="23" Margin="274,60,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="227"/>
<TextBox Name="TxtPassowrd" HorizontalAlignment="Left" Height="23" Margin="275,90,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="226"/>
<StatusBar HorizontalAlignment="Left" Height="24" Margin="14,279,0,0" VerticalAlignment="Top" Width="487">
<StatusBarItem>
<TextBlock Name="StatusBar" Text="未登录" />
</StatusBarItem>
</StatusBar>
</Grid>
</Window>
Loading

0 comments on commit b5358f9

Please sign in to comment.